{"id":22433610,"url":"https://github.com/gavinning/sdk-action","last_synced_at":"2025-08-30T12:41:49.464Z","repository":{"id":57101447,"uuid":"269019018","full_name":"gavinning/sdk-action","owner":"gavinning","description":"事件上报","archived":false,"fork":false,"pushed_at":"2020-08-29T11:01:51.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-11T03:21:01.556Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gavinning.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-06-03T07:26:21.000Z","updated_at":"2020-08-29T11:01:53.000Z","dependencies_parsed_at":"2022-08-20T18:10:50.011Z","dependency_job_id":null,"html_url":"https://github.com/gavinning/sdk-action","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gavinning/sdk-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gavinning%2Fsdk-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gavinning%2Fsdk-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gavinning%2Fsdk-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gavinning%2Fsdk-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gavinning","download_url":"https://codeload.github.com/gavinning/sdk-action/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gavinning%2Fsdk-action/sbom","scorecard":{"id":420015,"data":{"date":"2025-08-11","repo":{"name":"github.com/gavinning/sdk-action","commit":"481a9ecf9a2c2f36d75a15c8d9edf1de01cf3342"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 0/6 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-19T00:57:36.859Z","repository_id":57101447,"created_at":"2025-08-19T00:57:36.859Z","updated_at":"2025-08-19T00:57:36.859Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272852284,"owners_count":25004054,"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","status":"online","status_checked_at":"2025-08-30T02:00:09.474Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-12-05T22:15:26.378Z","updated_at":"2025-08-30T12:41:49.432Z","avatar_url":"https://github.com/gavinning.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Action\n---\n事件上报SDK\n\n### Install\n```sh\nnpm i @4a/sdk-action\n```\n\n### Usage\n```js\nconst Action = require('@4a/sdk-action')\n\nconst action = new Action({\n    axios: {\n        url: '/logo.gif',\n        method: 'POST',\n        baseURL: 'http://example.com',\n    },\n    params: {\n        app: 'app',\n        from: 'wechat',\n    }\n})\n\n// PV上报\n// 仅前端\naction.pv()\n\n// 通用事件上报\naction.event({\n    app: 'AppName',\n    mod: 'mode',\n    uid: 'gavinning',\n    tmp: 'tmpid',\n    pid: 'pid',\n    from: 'qq',\n    action: '测试事件',\n    result: 'ok',\n    message: '测试事件描述',\n    key: 'trade',\n    value: '123',\n    context: { a: 1 }\n})\n\n// 通用异常上报\naction.error({\n    app: 'errorapp',\n    mod: 'mode',\n    uid: 'gavinning',\n    tmp: 'tmpid',\n    pid: 'pid',\n    from: 'qq',\n    action: '测试错误',\n    result: 'fail',\n    message: '测试错误描述',\n    key: 'trade',\n    value: '123',\n    errid: '456',\n    stack: 'stack',\n    context: {b:1},\n})\n```\n\n### API\n```js\n/**\n * PV 仅前端可用\n * @param {Object} params 可选\n * @param {String} params.uid 关联用户id\n * @param {String} params.pid 关联PV记录id\n * @param {String} params.tmp 关联用户临时id\n * @param {String} params.url 当前PV地址\n * @param {String} params.screen 当前终端分辨率\n * @param {String} params.referrer referrer\n */\nPV(params = {})\n\n\n/**\n * Event上报\n * @param {Object | String} params 字符串默认处理为action\n * @param {String} params.app 项目名称\n * @param {String} params.mod 项目模块\n * @param {String} params.uid 关联用户id\n * @param {String} params.tmp 关联用户临时id\n * @param {String} params.pid 关联PV记录id\n * @param {String} params.from 关联来源\n * @param {String} params.action 上报事件简述\n * @param {String} params.result 上报事件状态\n * @param {String} params.message 上报事件详细描述\n * @param {String} params.key 关键字段\n * @param {String} params.value 关键字段值\n * @param {Object | String} params.context 上报事件上下文\n */\nevent(params)\n\n\n/**\n * Error上报\n * @param {Object | String} params 字符串默认处理为action\n * @param {String} params.app 项目名称\n * @param {String} params.mod 项目模块\n * @param {String} params.uid 关联用户id\n * @param {String} params.tmp 关联用户临时id\n * @param {String} params.pid 关联PV记录id\n * @param {String} params.from 关联来源\n * @param {String} params.action 上报事件简述\n * @param {String} params.result 上报事件状态\n * @param {String} params.message 上报事件详细描述\n * @param {String} params.key 关键字段\n * @param {String} params.value 关键字段值\n * @param {String} params.errid 错误记录id\n * @param {String} params.stack 错误栈\n * @param {Object | String} params.context 上报事件上下文\n */\nerror(params)\n```\n\n### Vue配置\n兼容性考虑``vue.config.js``文件中应添加以下配置\n```js\nmodule.exports = {\n    transpileDependencies: [\n        /[/\\\\]node_modules[/\\\\]@4a\\/sdk-action[/\\\\]/,\n    ],\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgavinning%2Fsdk-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgavinning%2Fsdk-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgavinning%2Fsdk-action/lists"}