pipework 0.68.0 → 0.70.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.
Files changed (64) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/REFERENCE.md +98 -1
  3. package/dist/core/config/namespace.d.ts +1 -0
  4. package/dist/core/config/namespace.d.ts.map +1 -1
  5. package/dist/core/config/schema.d.ts +3 -0
  6. package/dist/core/config/schema.d.ts.map +1 -1
  7. package/dist/core/config/schema.js +3 -1
  8. package/dist/core/config/schema.js.map +1 -1
  9. package/dist/data/migrate/internal-definitions.d.ts.map +1 -1
  10. package/dist/data/migrate/internal-definitions.js +8 -1
  11. package/dist/data/migrate/internal-definitions.js.map +1 -1
  12. package/dist/index.d.ts +2 -0
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/index.js +1 -0
  15. package/dist/index.js.map +1 -1
  16. package/dist/infra/access-links/index.d.ts +1 -0
  17. package/dist/infra/access-links/index.d.ts.map +1 -1
  18. package/dist/infra/access-links/namespace.d.ts +24 -0
  19. package/dist/infra/access-links/namespace.d.ts.map +1 -1
  20. package/dist/infra/access-links/namespace.js +23 -0
  21. package/dist/infra/access-links/namespace.js.map +1 -1
  22. package/dist/infra/access-links/person-check.d.ts +45 -0
  23. package/dist/infra/access-links/person-check.d.ts.map +1 -0
  24. package/dist/infra/access-links/person-check.js +128 -0
  25. package/dist/infra/access-links/person-check.js.map +1 -0
  26. package/dist/infra/access-links/schema.d.ts +8 -0
  27. package/dist/infra/access-links/schema.d.ts.map +1 -1
  28. package/dist/infra/access-links/schema.js +7 -1
  29. package/dist/infra/access-links/schema.js.map +1 -1
  30. package/dist/infra/alerts/audit.d.ts +3 -0
  31. package/dist/infra/alerts/audit.d.ts.map +1 -0
  32. package/dist/infra/alerts/audit.js +25 -0
  33. package/dist/infra/alerts/audit.js.map +1 -0
  34. package/dist/infra/alerts/handle.d.ts +95 -0
  35. package/dist/infra/alerts/handle.d.ts.map +1 -0
  36. package/dist/infra/alerts/handle.js +301 -0
  37. package/dist/infra/alerts/handle.js.map +1 -0
  38. package/dist/infra/alerts/index.d.ts +5 -0
  39. package/dist/infra/alerts/index.d.ts.map +1 -0
  40. package/dist/infra/alerts/index.js +2 -0
  41. package/dist/infra/alerts/index.js.map +1 -0
  42. package/dist/infra/alerts/namespace.d.ts +23 -0
  43. package/dist/infra/alerts/namespace.d.ts.map +1 -0
  44. package/dist/infra/alerts/namespace.js +23 -0
  45. package/dist/infra/alerts/namespace.js.map +1 -0
  46. package/dist/infra/alerts/schema.d.ts +123 -0
  47. package/dist/infra/alerts/schema.d.ts.map +1 -0
  48. package/dist/infra/alerts/schema.js +55 -0
  49. package/dist/infra/alerts/schema.js.map +1 -0
  50. package/dist/infra/alerts/sinks.d.ts +60 -0
  51. package/dist/infra/alerts/sinks.d.ts.map +1 -0
  52. package/dist/infra/alerts/sinks.js +50 -0
  53. package/dist/infra/alerts/sinks.js.map +1 -0
  54. package/dist/infra/alerts/sources.d.ts +55 -0
  55. package/dist/infra/alerts/sources.d.ts.map +1 -0
  56. package/dist/infra/alerts/sources.js +134 -0
  57. package/dist/infra/alerts/sources.js.map +1 -0
  58. package/dist/infra/email/sns.d.ts +1 -1
  59. package/dist/infra/email/sns.js +1 -1
  60. package/dist/infra/webhook/sign.d.ts +2 -0
  61. package/dist/infra/webhook/sign.d.ts.map +1 -1
  62. package/dist/infra/webhook/sign.js +1 -1
  63. package/dist/infra/webhook/sign.js.map +1 -1
  64. package/package.json +1 -1
@@ -18,7 +18,7 @@ export declare function snsStringToSign(msg: SnsMessage): string;
18
18
  * `pipework_email_suppressions`, which the send job checks; a transient or undetermined
19
19
  * bounce is only logged. Each one is a trace step with an `Email:bounce` / `Email:complaint`
20
20
  * audit record whose `after` carries `messageTraceId`, the trace of the original send.
21
- * A suppression is logged at warn as `email suppressed`; the alert condition (#458) is not built yet.
21
+ * A suppression is logged at warn as `email suppressed`; an app raises an alert for it with `alerts.create(...).raise`.
22
22
  *
23
23
  * Only messages from the configured `topicArns` are accepted (401 otherwise, before any subscription is
24
24
  * confirmed or event processed): SNS signs every topic, including an attacker's own.
@@ -86,7 +86,7 @@ const processEvent = __flowStep({ ref: 'pipework/email:notification' }, async (e
86
86
  * `pipework_email_suppressions`, which the send job checks; a transient or undetermined
87
87
  * bounce is only logged. Each one is a trace step with an `Email:bounce` / `Email:complaint`
88
88
  * audit record whose `after` carries `messageTraceId`, the trace of the original send.
89
- * A suppression is logged at warn as `email suppressed`; the alert condition (#458) is not built yet.
89
+ * A suppression is logged at warn as `email suppressed`; an app raises an alert for it with `alerts.create(...).raise`.
90
90
  *
91
91
  * Only messages from the configured `topicArns` are accepted (401 otherwise, before any subscription is
92
92
  * confirmed or event processed): SNS signs every topic, including an attacker's own.
@@ -1,6 +1,8 @@
1
1
  export interface WebhookSignatureOptions {
2
2
  algorithm?: string;
3
3
  encoding?: 'hex' | 'base64';
4
+ /** Message id to sign and return; default a fresh UUID. Pass a stable id so a retry is recognisable as the same message. */
5
+ messageId?: string;
4
6
  }
5
7
  export interface SignedPayload {
6
8
  body: string;
@@ -1 +1 @@
1
- {"version":3,"file":"sign.d.ts","sourceRoot":"","sources":["../../../src/infra/webhook/sign.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,uBAAuB;IACtC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAA;CAC5B;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,wBAAgB,WAAW,CACzB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,uBAA4B,GACpC,aAAa,CAWf"}
1
+ {"version":3,"file":"sign.d.ts","sourceRoot":"","sources":["../../../src/infra/webhook/sign.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,uBAAuB;IACtC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAA;IAC3B,4HAA4H;IAC5H,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,wBAAgB,WAAW,CACzB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,uBAA4B,GACpC,aAAa,CAWf"}
@@ -2,7 +2,7 @@ import { createHmac, randomUUID } from 'node:crypto';
2
2
  export function signPayload(payload, secret, options = {}) {
3
3
  const algorithm = options.algorithm ?? 'sha256';
4
4
  const encoding = options.encoding ?? 'hex';
5
- const messageId = randomUUID();
5
+ const messageId = options.messageId ?? randomUUID();
6
6
  const timestamp = Math.floor(Date.now() / 1000);
7
7
  const body = typeof payload === 'string' ? payload : JSON.stringify(payload);
8
8
  const toSign = `${messageId}.${timestamp}.${body}`;
@@ -1 +1 @@
1
- {"version":3,"file":"sign.js","sourceRoot":"","sources":["../../../src/infra/webhook/sign.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAcpD,MAAM,UAAU,WAAW,CACzB,OAAgB,EAChB,MAAc,EACd,UAAmC,EAAE;IAErC,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,QAAQ,CAAA;IAC/C,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,KAAK,CAAA;IAE1C,MAAM,SAAS,GAAG,UAAU,EAAE,CAAA;IAC9B,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAA;IAC/C,MAAM,IAAI,GA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AE/E,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,CAAA;AAClD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pipework",
3
- "version": "0.68.0",
3
+ "version": "0.70.0",
4
4
  "description": "TypeScript framework for multi-tenant SaaS applications. PostgreSQL-only.",
5
5
  "type": "module",
6
6
  "license": "MIT",