@iveri/contracts 0.18.0 → 0.20.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 (54) hide show
  1. package/README.md +37 -1
  2. package/dist/cjs/api/localization/message.type.d.ts +18 -2
  3. package/dist/cjs/api/localization/message.type.d.ts.map +1 -1
  4. package/dist/cjs/api/notification/index.d.ts +5 -0
  5. package/dist/cjs/api/notification/index.d.ts.map +1 -0
  6. package/dist/cjs/api/notification/index.js +21 -0
  7. package/dist/cjs/api/notification/index.js.map +1 -0
  8. package/dist/cjs/api/notification/notification-channel.enum.d.ts +27 -0
  9. package/dist/cjs/api/notification/notification-channel.enum.d.ts.map +1 -0
  10. package/dist/cjs/api/notification/notification-channel.enum.js +31 -0
  11. package/dist/cjs/api/notification/notification-channel.enum.js.map +1 -0
  12. package/dist/cjs/api/notification/notification-delivery-status.enum.d.ts +45 -0
  13. package/dist/cjs/api/notification/notification-delivery-status.enum.d.ts.map +1 -0
  14. package/dist/cjs/api/notification/notification-delivery-status.enum.js +49 -0
  15. package/dist/cjs/api/notification/notification-delivery-status.enum.js.map +1 -0
  16. package/dist/cjs/api/notification/notification-template.type.d.ts +68 -0
  17. package/dist/cjs/api/notification/notification-template.type.d.ts.map +1 -0
  18. package/dist/cjs/api/notification/notification-template.type.js +3 -0
  19. package/dist/cjs/api/notification/notification-template.type.js.map +1 -0
  20. package/dist/cjs/api/notification/notification.type.d.ts +136 -0
  21. package/dist/cjs/api/notification/notification.type.d.ts.map +1 -0
  22. package/dist/cjs/api/notification/notification.type.js +3 -0
  23. package/dist/cjs/api/notification/notification.type.js.map +1 -0
  24. package/dist/cjs/enum/user-permission.enum.d.ts +54 -1
  25. package/dist/cjs/enum/user-permission.enum.d.ts.map +1 -1
  26. package/dist/cjs/enum/user-permission.enum.js +54 -0
  27. package/dist/cjs/enum/user-permission.enum.js.map +1 -1
  28. package/dist/esm/api/localization/message.type.d.ts +18 -2
  29. package/dist/esm/api/localization/message.type.d.ts.map +1 -1
  30. package/dist/esm/api/notification/index.d.ts +5 -0
  31. package/dist/esm/api/notification/index.d.ts.map +1 -0
  32. package/dist/esm/api/notification/index.js +5 -0
  33. package/dist/esm/api/notification/index.js.map +1 -0
  34. package/dist/esm/api/notification/notification-channel.enum.d.ts +27 -0
  35. package/dist/esm/api/notification/notification-channel.enum.d.ts.map +1 -0
  36. package/dist/esm/api/notification/notification-channel.enum.js +28 -0
  37. package/dist/esm/api/notification/notification-channel.enum.js.map +1 -0
  38. package/dist/esm/api/notification/notification-delivery-status.enum.d.ts +45 -0
  39. package/dist/esm/api/notification/notification-delivery-status.enum.d.ts.map +1 -0
  40. package/dist/esm/api/notification/notification-delivery-status.enum.js +46 -0
  41. package/dist/esm/api/notification/notification-delivery-status.enum.js.map +1 -0
  42. package/dist/esm/api/notification/notification-template.type.d.ts +68 -0
  43. package/dist/esm/api/notification/notification-template.type.d.ts.map +1 -0
  44. package/dist/esm/api/notification/notification-template.type.js +2 -0
  45. package/dist/esm/api/notification/notification-template.type.js.map +1 -0
  46. package/dist/esm/api/notification/notification.type.d.ts +136 -0
  47. package/dist/esm/api/notification/notification.type.d.ts.map +1 -0
  48. package/dist/esm/api/notification/notification.type.js +2 -0
  49. package/dist/esm/api/notification/notification.type.js.map +1 -0
  50. package/dist/esm/enum/user-permission.enum.d.ts +54 -1
  51. package/dist/esm/enum/user-permission.enum.d.ts.map +1 -1
  52. package/dist/esm/enum/user-permission.enum.js +54 -0
  53. package/dist/esm/enum/user-permission.enum.js.map +1 -1
  54. package/package.json +9 -1
@@ -316,6 +316,60 @@ export var UserPermission;
316
316
  * key catalogue, and separating it keeps a compromised worker from enumerating it.
317
317
  */
318
318
  UserPermission["LOCALIZATION_RENDER"] = "localization:render";
319
+ // ══ iveri-notification-api ══════════════════════════════════════════════
320
+ /**
321
+ * Submit a notification for delivery.
322
+ *
323
+ * **A service permission, and the sharpest one here.** It reaches a real person's mailbox with
324
+ * text the platform composed, and it is not deliberately absent from the seeded `ADMIN` role
325
+ * the way `UNIBOX_REALTIME_PUBLISH` is — an admin has no reason to hold it, because there is
326
+ * nothing for a human to prove by sending a notification to somebody else by hand.
327
+ *
328
+ * Note what it does *not* let a holder do: a submission names a **template key**, never a
329
+ * subject and body. The wording of every notification the platform sends was written by
330
+ * somebody holding {@link UserPermission.NOTIFICATION_TEMPLATE_MANAGE} and translated by
331
+ * somebody holding {@link UserPermission.LOCALIZATION_TRANSLATE}. This is the same shape as
332
+ * `CONDUIT_DISPATCH_SEND` naming an operation rather than a URL, and it is load-bearing for
333
+ * the same reason: without it, a compromised service principal is an authenticated way to
334
+ * send arbitrary text from our own domain to any address it likes.
335
+ */
336
+ UserPermission["NOTIFICATION_SEND"] = "notification:send";
337
+ /**
338
+ * Read **your own** in-app inbox, and mark your own rows read.
339
+ *
340
+ * Scoped to the calling principal by the endpoint, not by this permission — there is no
341
+ * variant that reads somebody else's inbox, because a notification is addressed to one person
342
+ * and reading another's is reading their mail. It belongs in every human role, including the
343
+ * narrowest, for the same reason: without it a member cannot see what the product is telling
344
+ * them.
345
+ */
346
+ UserPermission["NOTIFICATION_READ"] = "notification:read";
347
+ /** Read the tenant's notification templates and the platform's built-in ones. */
348
+ UserPermission["NOTIFICATION_TEMPLATE_READ"] = "notification:template:read";
349
+ /**
350
+ * Override a built-in template, or define a new one — which channels a notification type
351
+ * reaches and which message keys it renders.
352
+ *
353
+ * Configuration that decides what every future notification of a type says, including the
354
+ * password-reset email. Overriding one badly is a way to stop people getting back into their
355
+ * accounts, so it is separated from reading for the same reason `CONDUIT_CONNECTOR_MANAGE` is.
356
+ */
357
+ UserPermission["NOTIFICATION_TEMPLATE_MANAGE"] = "notification:template:manage";
358
+ /**
359
+ * Read the delivery log and the dead-letter queue, including each delivery's last error.
360
+ *
361
+ * Grouped with reading rather than with operating the queue, and it is closer to a data-read
362
+ * permission than a config one: the log names who was written to and about what.
363
+ */
364
+ UserPermission["NOTIFICATION_DELIVERY_READ"] = "notification:delivery:read";
365
+ /**
366
+ * Redrive a dead-lettered delivery, or cancel one still pending.
367
+ *
368
+ * Separate from reading because it causes a message to be sent to a person rather than
369
+ * returning a row — and because redriving a backlog is a way to mail somebody the same thing
370
+ * fifty times an hour after an outage.
371
+ */
372
+ UserPermission["NOTIFICATION_DELIVERY_OPERATE"] = "notification:delivery:operate";
319
373
  })(UserPermission || (UserPermission = {}));
320
374
  /**
321
375
  * Every member, for seeding the owner role and validating custom-role input.
@@ -1 +1 @@
1
- {"version":3,"file":"user-permission.enum.js","sourceRoot":"","sources":["../../../src/enum/user-permission.enum.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAN,IAAY,cAqVX;AArVD,WAAY,cAAc;IACtB,4EAA4E;IAE5E,2EAA2E;IAC3E,6CAA2B,CAAA;IAC3B,iDAA+B,CAAA;IAC/B,sFAAsF;IACtF,iDAA+B,CAAA;IAE/B,2EAA2E;IAC3E,yCAAuB,CAAA;IACvB,6CAA2B,CAAA;IAC3B,6CAA2B,CAAA;IAC3B,6CAA2B,CAAA;IAE3B,2EAA2E;IAC3E,qDAAmC,CAAA;IACnC,6EAA6E;IAC7E,yDAAuC,CAAA;IACvC;;;OAGG;IACH,mEAAiD,CAAA;IAEjD,2EAA2E;IAC3E,yCAAuB,CAAA;IACvB,6CAA2B,CAAA;IAC3B,6CAA2B,CAAA;IAC3B,6CAA2B,CAAA;IAE3B,2EAA2E;IAC3E,+CAA6B,CAAA;IAC7B,iDAA+B,CAAA;IAC/B,mDAAiC,CAAA;IAEjC,4EAA4E;IAE5E,2EAA2E;IAC3E,qEAAqE;IACrE,iEAA+C,CAAA;IAC/C,qEAAmD,CAAA;IACnD,qEAAmD,CAAA;IACnD,qEAAmD,CAAA;IAEnD,2EAA2E;IAC3E;;;;OAIG;IACH,+DAA6C,CAAA;IAC7C,mEAAiD,CAAA;IAEjD,2EAA2E;IAC3E;;;;OAIG;IACH,mEAAiD,CAAA;IAEjD,2EAA2E;I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EAlZW,cAAc,KAAd,cAAc,QAkZzB;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAA8B,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iveri/contracts",
3
- "version": "0.18.0",
3
+ "version": "0.20.0",
4
4
  "description": "Wire contracts shared by every Iveri backend and frontend. Zero runtime dependencies.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -49,6 +49,11 @@
49
49
  "import": "./dist/esm/api/localization/index.js",
50
50
  "require": "./dist/cjs/api/localization/index.js"
51
51
  },
52
+ "./notification": {
53
+ "types": "./dist/cjs/api/notification/index.d.ts",
54
+ "import": "./dist/esm/api/notification/index.js",
55
+ "require": "./dist/cjs/api/notification/index.js"
56
+ },
52
57
  "./package.json": "./package.json"
53
58
  },
54
59
  "typesVersions": {
@@ -62,6 +67,9 @@
62
67
  "localization": [
63
68
  "./dist/cjs/api/localization/index.d.ts"
64
69
  ],
70
+ "notification": [
71
+ "./dist/cjs/api/notification/index.d.ts"
72
+ ],
65
73
  "unibox": [
66
74
  "./dist/cjs/api/unibox/index.d.ts"
67
75
  ],