@ascenda-one/github-collector 0.1.15 → 0.1.16
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/dist/cli.js +1747 -191
- package/dist/mapForgeEvent.js +10 -16
- package/dist/mapForgeEvent.js.map +1 -1
- package/package.json +1 -1
package/dist/mapForgeEvent.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { forgeProjectHash } from "@ascenda-one/tool-kit";
|
|
1
2
|
/**
|
|
2
3
|
* Maps a code-forge event to Ascenda's collaboration events (§4.2's
|
|
3
4
|
* collaboration family).
|
|
@@ -79,7 +80,15 @@ function base(payload) {
|
|
|
79
80
|
host: "github",
|
|
80
81
|
// Hashed, never the name. "Is it always the same repository" stays
|
|
81
82
|
// answerable; which repository does not travel.
|
|
82
|
-
|
|
83
|
+
//
|
|
84
|
+
// The digest is an UNSALTED FNV-1a of `owner/repo`, and this step stays
|
|
85
|
+
// deliberately salt-free: it runs in CI from a webhook payload, where the
|
|
86
|
+
// only place a machine salt could come from is a repository secret — which
|
|
87
|
+
// is to say, from everyone who can read the repository's settings. The
|
|
88
|
+
// function now lives in tool-kit so a developer's own machine, which holds
|
|
89
|
+
// both identities, can compute this exact digest and file it beside its
|
|
90
|
+
// own; nothing about what this step emits has changed.
|
|
91
|
+
...(repo ? { projectHash: forgeProjectHash(repo) } : {})
|
|
83
92
|
};
|
|
84
93
|
}
|
|
85
94
|
/**
|
|
@@ -91,21 +100,6 @@ function base(payload) {
|
|
|
91
100
|
function reviewState(state) {
|
|
92
101
|
return state?.toLowerCase() === "approved" ? "success" : "unknown";
|
|
93
102
|
}
|
|
94
|
-
/**
|
|
95
|
-
* FNV-1a. Not a security boundary and not pretending to be one — the
|
|
96
|
-
* repository name is low-entropy and a determined holder of the data could
|
|
97
|
-
* guess it. Its job is to keep names out of the payload and stable across
|
|
98
|
-
* events, which is what makes "the same repository" answerable without
|
|
99
|
-
* recording which one.
|
|
100
|
-
*/
|
|
101
|
-
function hash(value) {
|
|
102
|
-
let h = 0x811c9dc5;
|
|
103
|
-
for (let i = 0; i < value.length; i++) {
|
|
104
|
-
h ^= value.charCodeAt(i);
|
|
105
|
-
h = Math.imul(h, 0x01000193) >>> 0;
|
|
106
|
-
}
|
|
107
|
-
return h.toString(16).padStart(8, "0");
|
|
108
|
-
}
|
|
109
103
|
function obj(value) {
|
|
110
104
|
return value && typeof value === "object" ? value : {};
|
|
111
105
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapForgeEvent.js","sourceRoot":"","sources":["../src/mapForgeEvent.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mapForgeEvent.js","sourceRoot":"","sources":["../src/mapForgeEvent.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAezD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,UAAU,aAAa,CAC3B,SAA6B,EAC7B,OAAqB,EACrB,WAA+B;IAE/B,IAAI,CAAC,SAAS,IAAI,CAAC,WAAW;QAAE,OAAO,EAAE,CAAC;IAE1C,MAAM,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;IACtC,MAAM,MAAM,GAAG,WAAW,CAAC,WAAW,EAAE,CAAC;IAEzC,IAAI,SAAS,KAAK,cAAc,EAAE,CAAC;QACjC,MAAM,EAAE,GAAG,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC;QACxC,MAAM,MAAM,GAAG,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC;QAE5D,IAAI,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;YAC7C,OAAO,CAAC;oBACN,SAAS,EAAE,qBAAqB;oBAChC,QAAQ,EAAE,KAAK;oBACf,QA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AG,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC;IAC1D,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,mEAAmE;QACnE,gDAAgD;QAChD,EAAE;QACF,wEAAwE;QACxE,0EAA0E;QAC1E,2EAA2E;QAC3E,uEAAuE;QACvE,2EAA2E;QAC3E,wEAAwE;QACxE,uDAAuD;QACvD,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACzD,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,SAAS,WAAW,CAAC,KAAyB;IAC5C,OAAO,KAAK,EAAE,WAAW,EAAE,KAAK,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC;AACrE,CAAC;AAED,SAAS,GAAG,CAAC,KAAc;IACzB,OAAO,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAE,KAAiC,CAAC,CAAC,CAAC,EAAE,CAAC;AACtF,CAAC;AAED,SAAS,GAAG,CAAC,KAAc;IACzB,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AAC3E,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"publishConfig": { "access": "public" },
|
|
3
3
|
"name": "@ascenda-one/github-collector",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.16",
|
|
5
5
|
"description": "Code-forge collaboration collector for Ascenda work telemetry — first-person review and pull-request signals.",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|