@spotify/backstage-plugin-soundcheck-backend-module-github 0.8.1 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var o=require("./helper/util.cjs.js"),b=require("./schema/dependabot_alerts.json.cjs.js"),f=require("./utils.cjs.js");class c{static TYPE="DependabotAlerts";#t;#e;type=c.TYPE;static factory=({logger:t,cache:n})=>{const s=new c(t,n);return{predicate:h=>h.type===s.type,extractor:s}};constructor(t,n){this.#t=t,this.#e=n}async extract(t,n,s,h,g){const l=[],u={owner:s.owner,repo:s.name,state:t.states?.join(","),severity:t.severities?.join(",")},w=100;let y=0,i=!0,p;for(;i;){const d=f.getCacheKey("github:dependabot_alerts",u,++y);try{const e=await h.rest.dependabot.listAlertsForRepo({...u,per_page:w,after:p,headers:g?void 0:await f.getCacheHeader(this.#e,d)});if(!e.headers?.link?.includes('rel="next"'))i=!1;else{const r=e.headers.link.match(/<([^>]+)>;\s*rel="next"/);r&&(p=new URL(r[1]).searchParams.get("after")??void 0),p||(i=!1)}const a=e.data;await this.#e.set(d,{etag:e.headers?.etag,lastModified:e.headers?.date,hasNext:i,data:a}),l.push(...a)}catch(e){if(o.isNotModifiedError(e)){const r=await this.#e.get(d);if(r){l.push(...r.data),i=r.hasNext,await this.#e.set(d,r);continue}else return}if(o.isNotFoundError(e))return{alerts:[]};if(o.isForbiddenError(e))return e.response.data;const a=`[DependabotAlerts] fact extraction failed with: ${o.buildOctokitErrorMessage(e)}. Request parameters: ${JSON.stringify(u)}`;throw o.handleRateLimitError(e,a),this.#t.error(a),new Error(a)}}return{alerts:l}}getDataSchema(t){return JSON.stringify(b.default)}}exports.DependabotAlertsFactExtractor=c;
|
|
2
2
|
//# sourceMappingURL=DependabotAlertsFactExtractor.cjs.js.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spotify/backstage-plugin-soundcheck-backend-module-github",
|
|
3
3
|
"description": "Soundcheck 3rd party integration with Github",
|
|
4
|
-
"version": "0.8.
|
|
4
|
+
"version": "0.8.2",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"homepage": "https://backstage.spotify.com",
|
|
7
7
|
"main": "dist/index.cjs.js",
|