@bevel-software/platform-core-backend 0.31.0 → 0.32.0
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/core/create-core-services.d.ts +7 -0
- package/dist/core/create-core-services.d.ts.map +1 -1
- package/dist/core/create-core-services.js +12 -1
- package/dist/core/create-core-services.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/modules/access-model/index.d.ts +14 -0
- package/dist/modules/access-model/index.d.ts.map +1 -0
- package/dist/modules/access-model/index.js +13 -0
- package/dist/modules/access-model/index.js.map +1 -0
- package/dist/modules/auth/account-hooks.d.ts +4 -6
- package/dist/modules/auth/account-hooks.d.ts.map +1 -1
- package/dist/modules/auth/account-hooks.js +7 -17
- package/dist/modules/auth/account-hooks.js.map +1 -1
- package/dist/modules/auth/auth.service.d.ts +9 -8
- package/dist/modules/auth/auth.service.d.ts.map +1 -1
- package/dist/modules/auth/auth.service.js +19 -18
- package/dist/modules/auth/auth.service.js.map +1 -1
- package/dist/modules/database/core-schema.d.ts +21 -1
- package/dist/modules/database/core-schema.d.ts.map +1 -1
- package/dist/modules/database/core-schema.js +16 -1
- package/dist/modules/database/core-schema.js.map +1 -1
- package/dist/modules/mcp/oauth/bevel-oauth-provider.d.ts +28 -0
- package/dist/modules/mcp/oauth/bevel-oauth-provider.d.ts.map +1 -1
- package/dist/modules/mcp/oauth/bevel-oauth-provider.js +166 -39
- package/dist/modules/mcp/oauth/bevel-oauth-provider.js.map +1 -1
- package/dist/modules/workflow/agent-tools/change-request-summary.d.ts +10 -1
- package/dist/modules/workflow/agent-tools/change-request-summary.d.ts.map +1 -1
- package/dist/modules/workflow/agent-tools/change-request-summary.js +2 -0
- package/dist/modules/workflow/agent-tools/change-request-summary.js.map +1 -1
- package/dist/modules/workflow/agent-tools/workflow.tools.d.ts.map +1 -1
- package/dist/modules/workflow/agent-tools/workflow.tools.js +5 -0
- package/dist/modules/workflow/agent-tools/workflow.tools.js.map +1 -1
- package/dist/modules/workflow/change-request-hooks.d.ts +78 -0
- package/dist/modules/workflow/change-request-hooks.d.ts.map +1 -0
- package/dist/modules/workflow/change-request-hooks.js +15 -0
- package/dist/modules/workflow/change-request-hooks.js.map +1 -0
- package/dist/modules/workflow/git/pull-request.service.d.ts +10 -0
- package/dist/modules/workflow/git/pull-request.service.d.ts.map +1 -1
- package/dist/modules/workflow/git/pull-request.service.js +9 -0
- package/dist/modules/workflow/git/pull-request.service.js.map +1 -1
- package/dist/modules/workflow/workflow.service.d.ts +75 -15
- package/dist/modules/workflow/workflow.service.d.ts.map +1 -1
- package/dist/modules/workflow/workflow.service.js +163 -32
- package/dist/modules/workflow/workflow.service.js.map +1 -1
- package/dist/shared/listener-seam.d.ts +34 -0
- package/dist/shared/listener-seam.d.ts.map +1 -0
- package/dist/shared/listener-seam.js +42 -0
- package/dist/shared/listener-seam.js.map +1 -0
- package/migrations/0019_oauth_token_rotated_at.sql +7 -0
- package/migrations/meta/0019_snapshot.json +2435 -0
- package/migrations/meta/_journal.json +7 -0
- package/package.json +3 -3
- package/src/core/create-core-services.ts +17 -0
- package/src/index.ts +7 -0
- package/src/modules/access-model/index.ts +13 -0
- package/src/modules/auth/__tests__/account-deactivation.test.ts +38 -2
- package/src/modules/auth/account-hooks.ts +13 -21
- package/src/modules/auth/auth.service.ts +19 -18
- package/src/modules/database/core-schema.ts +16 -1
- package/src/modules/mcp/__tests__/bevel-oauth-provider.pg.test.ts +279 -0
- package/src/modules/mcp/__tests__/bevel-oauth-provider.test.ts +190 -15
- package/src/modules/mcp/oauth/bevel-oauth-provider.ts +214 -48
- package/src/modules/workflow/__tests__/change-request-hooks.test.ts +62 -0
- package/src/modules/workflow/__tests__/workflow.routes.open-change-request.test.ts +79 -0
- package/src/modules/workflow/__tests__/workflow.service.delete-branch.test.ts +9 -1
- package/src/modules/workflow/__tests__/workflow.service.facade.test.ts +258 -1
- package/src/modules/workflow/agent-tools/__tests__/workflow.tools.test.ts +10 -0
- package/src/modules/workflow/agent-tools/change-request-summary.ts +10 -1
- package/src/modules/workflow/agent-tools/workflow.tools.ts +6 -0
- package/src/modules/workflow/change-request-hooks.ts +96 -0
- package/src/modules/workflow/git/pull-request.service.ts +10 -0
- package/src/modules/workflow/workflow.service.ts +188 -40
- package/src/shared/listener-seam.ts +52 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one way core runs the notification listeners a deployment registers
|
|
3
|
+
* on a seam (an account invited, a change request opened): every listener
|
|
4
|
+
* in registration order, each awaited, the channels that reached somebody
|
|
5
|
+
* collected in that order, a failure logged and counted as "did not" so the
|
|
6
|
+
* event's own effect — the account made, the request opened — stands
|
|
7
|
+
* whatever the listeners do. A seam wraps one of these per event and keeps
|
|
8
|
+
* its own typed registration method, so the rule above is written once.
|
|
9
|
+
*/
|
|
10
|
+
export class ListenerSeam {
|
|
11
|
+
log;
|
|
12
|
+
failed;
|
|
13
|
+
listeners = [];
|
|
14
|
+
/**
|
|
15
|
+
* @param log Where a failed listener is reported.
|
|
16
|
+
* @param failed The line logged for one, said in the seam's own terms
|
|
17
|
+
* ("an account-invited listener failed; the person was not notified by it:").
|
|
18
|
+
*/
|
|
19
|
+
constructor(log, failed) {
|
|
20
|
+
this.log = log;
|
|
21
|
+
this.failed = failed;
|
|
22
|
+
}
|
|
23
|
+
add(listener) {
|
|
24
|
+
this.listeners.push(listener);
|
|
25
|
+
}
|
|
26
|
+
/** Run every listener in registration order; the channels that reached somebody, in that order. */
|
|
27
|
+
async run(event) {
|
|
28
|
+
const notified = [];
|
|
29
|
+
for (const listener of this.listeners) {
|
|
30
|
+
try {
|
|
31
|
+
const channel = await listener(event);
|
|
32
|
+
if (channel !== null && channel !== '')
|
|
33
|
+
notified.push(channel);
|
|
34
|
+
}
|
|
35
|
+
catch (err) {
|
|
36
|
+
this.log.error(this.failed, { err });
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return notified;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=listener-seam.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"listener-seam.js","sourceRoot":"","sources":["../../src/shared/listener-seam.ts"],"names":[],"mappings":"AAYA;;;;;;;;GAQG;AACH,MAAM,OAAO,YAAY;IASJ;IACA;IATF,SAAS,GAA2B,EAAE,CAAC;IAExD;;;;OAIG;IACH,YACmB,GAAY,EACZ,MAAc;QADd,QAAG,GAAH,GAAG,CAAS;QACZ,WAAM,GAAN,MAAM,CAAQ;IAC9B,CAAC;IAEJ,GAAG,CAAC,QAA8B;QAChC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAChC,CAAC;IAED,mGAAmG;IACnG,KAAK,CAAC,GAAG,CAAC,KAAQ;QAChB,MAAM,QAAQ,GAAa,EAAE,CAAC;QAC9B,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACtC,IAAI,CAAC;gBACH,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,KAAK,CAAC,CAAC;gBACtC,IAAI,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,EAAE;oBAAE,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACjE,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;YACvC,CAAC;QACH,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
-- When a refresh of the row's refresh token minted its successor. Rotation
|
|
2
|
+
-- sets it; a revoke never does, so the two are told apart: a rotated row's
|
|
3
|
+
-- access token still verifies until its own expiry, and its refresh token is
|
|
4
|
+
-- honoured once more within the reuse grace, while a revoked row does neither
|
|
5
|
+
-- (see `exchangeRefreshToken` in bevel-oauth-provider.ts). Null on every
|
|
6
|
+
-- existing row, which rotation then marks as it does any other.
|
|
7
|
+
ALTER TABLE "oauth_tokens" ADD COLUMN "rotated_at" timestamp;
|