{"id":19411580,"url":"https://github.com/volcengine/datafinder-sdk-openapi-js","last_synced_at":"2025-06-26T23:38:23.682Z","repository":{"id":39462058,"uuid":"472209319","full_name":"volcengine/datafinder-sdk-openapi-js","owner":"volcengine","description":null,"archived":false,"fork":false,"pushed_at":"2022-06-01T04:09:06.000Z","size":21,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-07T15:21:17.596Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/volcengine.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-03-21T06:14:08.000Z","updated_at":"2024-12-25T09:41:12.000Z","dependencies_parsed_at":"2022-09-11T22:50:29.210Z","dependency_job_id":null,"html_url":"https://github.com/volcengine/datafinder-sdk-openapi-js","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/volcengine%2Fdatafinder-sdk-openapi-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/volcengine%2Fdatafinder-sdk-openapi-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/volcengine%2Fdatafinder-sdk-openapi-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/volcengine%2Fdatafinder-sdk-openapi-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/volcengine","download_url":"https://codeload.github.com/volcengine/datafinder-sdk-openapi-js/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240589029,"owners_count":19825285,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T12:22:06.803Z","updated_at":"2025-02-25T02:29:17.841Z","avatar_url":"https://github.com/volcengine.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# openapi 使用说明\n\n### 1. 语法\ncommon js 语法\n\n### 2、样例\n\n\n* 调用服务\nquery.js\n```js\nconst oepnapisdk = require(\"@/datafinder/openapisdk\");\nconst RangersClient = oepnapisdk.RangersClient;\n\nfunction testQuery() {\n    ak = \"xxxx\"\n    sk = \"xxxx\"\n    rc = new RangersClient(ak, sk)\n    dsl = {\n        \"version\": 3,\n        \"app_ids\": [0],\n        \"use_app_cloud_id\": true,\n        \"periods\": [\n            {\n                \"granularity\": \"day\",\n                \"type\": \"last\",\n                \"last\": {\n                    \"amount\": 5,\n                    \"unit\": \"day\"\n                },\n                \"timezone\": \"Asia/Shanghai\"\n            }\n        ],\n        \"contents\": [\n            {\n                \"query_type\": \"event\",\n                \"profile_groups\": [],\n                \"profile_filters\": [],\n                \"queries\": [\n                    [\n                        {\n                            \"event_type\": \"origin\",\n                            \"show_name\": \"活跃用户数\",\n                            \"event_name\": \"app_launch\",\n                            \"groups\": [],\n                            \"filters\": [],\n                            \"show_label\": \"active_user\",\n                            \"event_indicator\": \"event_users\"\n                        }\n                    ]\n                ],\n                \"option\": {\n                    \"skip_cache\": false\n                }\n            }\n        ]\n    }\n    resp = rc.dataFinder(\"/openapi/v1/analysis\", { body: JSON.stringify(dsl) })\n        .then(res =\u003e res.json())\n        .then(response =\u003e {\n            console.log(\"response: \" + JSON.stringify(response));\n            if (200 !== response['code']) {\n                throw \"result is not ok, code: \" + response['code'] + \", message: \" + response['message'];\n            }\n            result = response['data']\n            result.forEach(item =\u003e {\n                if ('SUCCESS' !== item['result_status']) {\n                    throw \"result item is not ok, status: \" + item['result_status'] + \", error message: \" + item['error_message'];\n                }\n            })\n\n            console.log('success.')\n        })\n        .catch(error =\u003e console.error('error:', error));\n}\n```\n\n* 运行测试用例：\n```shell\nnode query.js\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvolcengine%2Fdatafinder-sdk-openapi-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvolcengine%2Fdatafinder-sdk-openapi-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvolcengine%2Fdatafinder-sdk-openapi-js/lists"}