@warlock.js/notifications 5.30.0 → 5.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/CHANGELOG.md +22 -1
- package/cjs/index.cjs +2 -2
- package/cjs/index.cjs.map +1 -1
- package/esm/channels/database-channel.d.mts +2 -3
- package/esm/channels/database-channel.d.mts.map +1 -1
- package/esm/channels/index.d.mts +2 -1
- package/esm/channels/index.mjs +1 -1
- package/esm/channels/mail-channel.d.mts +6 -4
- package/esm/channels/mail-channel.d.mts.map +1 -1
- package/esm/config.d.mts +13 -9
- package/esm/config.d.mts.map +1 -1
- package/esm/config.mjs.map +1 -1
- package/esm/contracts/channel.contract.d.mts +1 -3
- package/esm/contracts/channel.contract.d.mts.map +1 -1
- package/esm/contracts/index.d.mts +2 -1
- package/esm/contracts/notification.contract.d.mts +1 -3
- package/esm/contracts/notification.contract.d.mts.map +1 -1
- package/esm/contracts/preference-provider.contract.d.mts +1 -3
- package/esm/contracts/preference-provider.contract.d.mts.map +1 -1
- package/esm/contracts/queue-dispatcher.contract.d.mts +1 -3
- package/esm/contracts/queue-dispatcher.contract.d.mts.map +1 -1
- package/esm/contracts/rate-limiter.contract.d.mts +1 -3
- package/esm/contracts/rate-limiter.contract.d.mts.map +1 -1
- package/esm/dispatch/define-channel.d.mts +2 -2
- package/esm/dispatch/define-channel.d.mts.map +1 -1
- package/esm/dispatch/define-notification.d.mts +5 -6
- package/esm/dispatch/define-notification.d.mts.map +1 -1
- package/esm/dispatch/define-notification.mjs.map +1 -1
- package/esm/dispatch/index.d.mts +2 -1
- package/esm/dispatch/index.mjs +1 -1
- package/esm/dispatch/notifications-event-bus.d.mts +2 -3
- package/esm/dispatch/notifications-event-bus.d.mts.map +1 -1
- package/esm/dispatch/notify.d.mts +3 -5
- package/esm/dispatch/notify.d.mts.map +1 -1
- package/esm/dispatch/notify.mjs.map +1 -1
- package/esm/errors.d.mts +5 -6
- package/esm/errors.d.mts.map +1 -1
- package/esm/in-app/base-notifications-repository.d.mts +6 -6
- package/esm/in-app/base-notifications-repository.d.mts.map +1 -1
- package/esm/in-app/base-notifications-repository.mjs +1 -1
- package/esm/in-app/base-notifications-repository.mjs.map +1 -1
- package/esm/in-app/column-map.d.mts +11 -8
- package/esm/in-app/column-map.d.mts.map +1 -1
- package/esm/in-app/database-notification.d.mts +2 -3
- package/esm/in-app/database-notification.d.mts.map +1 -1
- package/esm/in-app/in-app.d.mts +6 -5
- package/esm/in-app/in-app.d.mts.map +1 -1
- package/esm/in-app/index.d.mts +2 -1
- package/esm/in-app/index.mjs +1 -1
- package/esm/index.d.mts +6 -0
- package/esm/migration/index.d.mts +2 -1
- package/esm/migration/index.mjs +1 -1
- package/esm/migration/notification-columns.d.mts +6 -7
- package/esm/migration/notification-columns.d.mts.map +1 -1
- package/esm/migration/notification-columns.mjs.map +1 -1
- package/esm/queue/bullmq-queue.d.mts +9 -7
- package/esm/queue/bullmq-queue.d.mts.map +1 -1
- package/esm/queue/bullmq-queue.mjs.map +1 -1
- package/esm/queue/herald-queue.d.mts +6 -4
- package/esm/queue/herald-queue.d.mts.map +1 -1
- package/esm/queue/index.d.mts +2 -1
- package/esm/queue/index.mjs +1 -1
- package/esm/queue/load-herald.d.mts +1 -2
- package/esm/queue/load-herald.d.mts.map +1 -1
- package/esm/queue/load-herald.mjs +1 -1
- package/esm/queue/load-queue.d.mts +2 -3
- package/esm/queue/load-queue.d.mts.map +1 -1
- package/esm/queue/notifications-worker.d.mts +5 -4
- package/esm/queue/notifications-worker.d.mts.map +1 -1
- package/esm/queue/notifications-worker.mjs.map +1 -1
- package/esm/queue/queue-package-not-installed.error.d.mts +1 -2
- package/esm/queue/queue-package-not-installed.error.d.mts.map +1 -1
- package/esm/types.d.mts +22 -18
- package/esm/types.d.mts.map +1 -1
- package/llms-full.txt +89 -81
- package/package.json +10 -9
- package/skills/configure-notifications/SKILL.md +7 -7
- package/skills/define-channel/SKILL.md +9 -7
- package/skills/define-notification/SKILL.md +22 -25
- package/skills/index.md +4 -1
- package/skills/notifications-basics/SKILL.md +12 -12
- package/skills/observe-notifications/SKILL.md +14 -10
- package/skills/send-ad-hoc/SKILL.md +9 -9
- package/skills/use-in-app/SKILL.md +6 -4
- package/skills/write-notification-migration/SKILL.md +10 -7
- package/cjs/channel_api-C5ZZDkgQ.cjs +0 -7463
- package/cjs/channel_api-C5ZZDkgQ.cjs.map +0 -1
- package/cjs/chunk-fl3r8ClO.cjs +0 -41
- package/cjs/rabbitmq-driver-BFoWr21L.cjs +0 -3
- package/cjs/src-eu2jxS21.cjs +0 -11190
- package/cjs/src-eu2jxS21.cjs.map +0 -1
- package/esm/_virtual/_rolldown/runtime.mjs +0 -32
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/Random/_internal.mjs +0 -6
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/Random/_internal.mjs.map +0 -1
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/Random/bool.mjs +0 -3
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/Random/color.mjs +0 -3
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/Random/date.mjs +0 -3
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/Random/float.mjs +0 -3
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/Random/id.mjs +0 -3
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/Random/int.mjs +0 -3
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/Random/nanoid.mjs +0 -3
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/Random/pick.mjs +0 -3
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/Random/random.mjs +0 -16
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/Random/sample.mjs +0 -3
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/Random/string.mjs +0 -3
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/Random/token.mjs +0 -3
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/Random/uuid.mjs +0 -3
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/Random/weighted.mjs +0 -3
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/async/retry.mjs +0 -3
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/index.mjs +0 -24
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/mixed/clone/clone.mjs +0 -82
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/mixed/clone/clone.mjs.map +0 -1
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/number/round.mjs +0 -17
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/number/round.mjs.map +0 -1
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/object/except.mjs +0 -13
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/object/except.mjs.map +0 -1
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/object/get.mjs +0 -18
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/object/get.mjs.map +0 -1
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/object/omit.mjs +0 -17
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/object/omit.mjs.map +0 -1
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/object/unset.mjs +0 -30
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/object/unset.mjs.map +0 -1
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/string/capitalize.mjs +0 -19
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/string/capitalize.mjs.map +0 -1
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/string/ltrim.mjs +0 -18
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/string/ltrim.mjs.map +0 -1
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/string/readMoreChars.mjs +0 -14
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/string/readMoreChars.mjs.map +0 -1
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/string/rtrim.mjs +0 -18
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/string/rtrim.mjs.map +0 -1
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/string/toCamelCase.mjs +0 -22
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/string/toCamelCase.mjs.map +0 -1
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/string/toKebabCase.mjs +0 -17
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/string/toKebabCase.mjs.map +0 -1
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/string/toSnakeCase.mjs +0 -21
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/string/toSnakeCase.mjs.map +0 -1
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/string/toStudlyCase.mjs +0 -21
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/string/toStudlyCase.mjs.map +0 -1
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/string/trim.mjs +0 -20
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/string/trim.mjs.map +0 -1
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/string/ucfirst.mjs +0 -15
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/string/ucfirst.mjs.map +0 -1
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/string/words.mjs +0 -25
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/string/words.mjs.map +0 -1
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/utils/escapeRegex.mjs +0 -11
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/utils/escapeRegex.mjs.map +0 -1
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/utils/lazy.mjs +0 -100
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/utils/lazy.mjs.map +0 -1
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/utils/tap.mjs +0 -27
- package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.2/node_modules/@mongez/reinforcements/esm/utils/tap.mjs.map +0 -1
- package/esm/node_modules/.pnpm/@mongez_supportive-is@3.0.0/node_modules/@mongez/supportive-is/esm/index.mjs +0 -358
- package/esm/node_modules/.pnpm/@mongez_supportive-is@3.0.0/node_modules/@mongez/supportive-is/esm/index.mjs.map +0 -1
- package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/channel_api.mjs +0 -28
- package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/channel_api.mjs.map +0 -1
- package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/api_args.mjs +0 -241
- package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/api_args.mjs.map +0 -1
- package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/bitset.mjs +0 -130
- package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/bitset.mjs.map +0 -1
- package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/channel.mjs +0 -302
- package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/channel.mjs.map +0 -1
- package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/channel_model.mjs +0 -206
- package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/channel_model.mjs.map +0 -1
- package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/codec.mjs +0 -273
- package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/codec.mjs.map +0 -1
- package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/connect.mjs +0 -143
- package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/connect.mjs.map +0 -1
- package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/connection.mjs +0 -416
- package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/connection.mjs.map +0 -1
- package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/credentials.mjs +0 -50
- package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/credentials.mjs.map +0 -1
- package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/defs.mjs +0 -4600
- package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/defs.mjs.map +0 -1
- package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/error.mjs +0 -29
- package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/error.mjs.map +0 -1
- package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/format.mjs +0 -28
- package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/format.mjs.map +0 -1
- package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/frame.mjs +0 -130
- package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/frame.mjs.map +0 -1
- package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/heartbeat.mjs +0 -40
- package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/heartbeat.mjs.map +0 -1
- package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/mux.mjs +0 -86
- package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/mux.mjs.map +0 -1
- package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/package.mjs +0 -41
- package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/package.mjs.map +0 -1
- package/esm/node_modules/.pnpm/buffer-more-ints@1.0.0/node_modules/buffer-more-ints/buffer-more-ints.mjs +0 -360
- package/esm/node_modules/.pnpm/buffer-more-ints@1.0.0/node_modules/buffer-more-ints/buffer-more-ints.mjs.map +0 -1
- package/esm/node_modules/.pnpm/dayjs@1.11.23/node_modules/dayjs/dayjs.min.mjs +0 -305
- package/esm/node_modules/.pnpm/dayjs@1.11.23/node_modules/dayjs/dayjs.min.mjs.map +0 -1
- package/esm/node_modules/.pnpm/querystringify@2.2.0/node_modules/querystringify/index.mjs +0 -80
- package/esm/node_modules/.pnpm/querystringify@2.2.0/node_modules/querystringify/index.mjs.map +0 -1
- package/esm/node_modules/.pnpm/requires-port@1.0.0/node_modules/requires-port/index.mjs +0 -35
- package/esm/node_modules/.pnpm/requires-port@1.0.0/node_modules/requires-port/index.mjs.map +0 -1
- package/esm/node_modules/.pnpm/url-parse@1.5.10/node_modules/url-parse/index.mjs +0 -388
- package/esm/node_modules/.pnpm/url-parse@1.5.10/node_modules/url-parse/index.mjs.map +0 -1
- package/esm/packages/herald/src/communicators/broker-registry.mjs +0 -204
- package/esm/packages/herald/src/communicators/broker-registry.mjs.map +0 -1
- package/esm/packages/herald/src/communicators/broker.mjs +0 -110
- package/esm/packages/herald/src/communicators/broker.mjs.map +0 -1
- package/esm/packages/herald/src/communicators/index.mjs +0 -4
- package/esm/packages/herald/src/decorators/consumable.mjs +0 -36
- package/esm/packages/herald/src/decorators/consumable.mjs.map +0 -1
- package/esm/packages/herald/src/decorators/index.mjs +0 -3
- package/esm/packages/herald/src/drivers/index.mjs +0 -5
- package/esm/packages/herald/src/drivers/rabbitmq/index.mjs +0 -4
- package/esm/packages/herald/src/drivers/rabbitmq/rabbitmq-channel.mjs +0 -403
- package/esm/packages/herald/src/drivers/rabbitmq/rabbitmq-channel.mjs.map +0 -1
- package/esm/packages/herald/src/drivers/rabbitmq/rabbitmq-driver.mjs +0 -303
- package/esm/packages/herald/src/drivers/rabbitmq/rabbitmq-driver.mjs.map +0 -1
- package/esm/packages/herald/src/index.mjs +0 -16
- package/esm/packages/herald/src/message-managers/event-consumer.mjs +0 -76
- package/esm/packages/herald/src/message-managers/event-consumer.mjs.map +0 -1
- package/esm/packages/herald/src/message-managers/event-message.mjs +0 -85
- package/esm/packages/herald/src/message-managers/event-message.mjs.map +0 -1
- package/esm/packages/herald/src/message-managers/index.mjs +0 -4
- package/esm/packages/herald/src/message-managers/prepare-consumer-subscription.mjs +0 -42
- package/esm/packages/herald/src/message-managers/prepare-consumer-subscription.mjs.map +0 -1
- package/esm/packages/herald/src/use-case-broadcast.mjs +0 -30
- package/esm/packages/herald/src/use-case-broadcast.mjs.map +0 -1
- package/esm/packages/herald/src/utils/connect-to-broker.mjs +0 -168
- package/esm/packages/herald/src/utils/connect-to-broker.mjs.map +0 -1
- package/esm/packages/herald/src/utils/index.mjs +0 -3
- package/esm/packages/seal/src/config.mjs +0 -15
- package/esm/packages/seal/src/config.mjs.map +0 -1
- package/esm/packages/seal/src/factory/index.mjs +0 -4
- package/esm/packages/seal/src/factory/validate.mjs +0 -42
- package/esm/packages/seal/src/factory/validate.mjs.map +0 -1
- package/esm/packages/seal/src/factory/validators.mjs +0 -133
- package/esm/packages/seal/src/factory/validators.mjs.map +0 -1
- package/esm/packages/seal/src/helpers/date-helpers.mjs +0 -24
- package/esm/packages/seal/src/helpers/date-helpers.mjs.map +0 -1
- package/esm/packages/seal/src/helpers/get-field-value.mjs +0 -46
- package/esm/packages/seal/src/helpers/get-field-value.mjs.map +0 -1
- package/esm/packages/seal/src/helpers/index.mjs +0 -6
- package/esm/packages/seal/src/helpers/is-empty-value.mjs +0 -10
- package/esm/packages/seal/src/helpers/is-empty-value.mjs.map +0 -1
- package/esm/packages/seal/src/helpers/path-helpers.mjs +0 -12
- package/esm/packages/seal/src/helpers/path-helpers.mjs.map +0 -1
- package/esm/packages/seal/src/helpers/validation-helpers.mjs +0 -78
- package/esm/packages/seal/src/helpers/validation-helpers.mjs.map +0 -1
- package/esm/packages/seal/src/index.mjs +0 -88
- package/esm/packages/seal/src/mutators/array-mutators.mjs +0 -32
- package/esm/packages/seal/src/mutators/array-mutators.mjs.map +0 -1
- package/esm/packages/seal/src/mutators/boolean-mutators.mjs +0 -40
- package/esm/packages/seal/src/mutators/boolean-mutators.mjs.map +0 -1
- package/esm/packages/seal/src/mutators/date-mutators.mjs +0 -94
- package/esm/packages/seal/src/mutators/date-mutators.mjs.map +0 -1
- package/esm/packages/seal/src/mutators/index.mjs +0 -9
- package/esm/packages/seal/src/mutators/number-mutators.mjs +0 -52
- package/esm/packages/seal/src/mutators/number-mutators.mjs.map +0 -1
- package/esm/packages/seal/src/mutators/object-mutators.mjs +0 -30
- package/esm/packages/seal/src/mutators/object-mutators.mjs.map +0 -1
- package/esm/packages/seal/src/mutators/scalar-mutators.mjs +0 -9
- package/esm/packages/seal/src/mutators/scalar-mutators.mjs.map +0 -1
- package/esm/packages/seal/src/mutators/string-mutators.mjs +0 -186
- package/esm/packages/seal/src/mutators/string-mutators.mjs.map +0 -1
- package/esm/packages/seal/src/object.mjs +0 -13
- package/esm/packages/seal/src/object.mjs.map +0 -1
- package/esm/packages/seal/src/rules/array/array-rules.mjs +0 -41
- package/esm/packages/seal/src/rules/array/array-rules.mjs.map +0 -1
- package/esm/packages/seal/src/rules/array/index.mjs +0 -3
- package/esm/packages/seal/src/rules/color/color-rules.mjs +0 -104
- package/esm/packages/seal/src/rules/color/color-rules.mjs.map +0 -1
- package/esm/packages/seal/src/rules/color/index.mjs +0 -3
- package/esm/packages/seal/src/rules/common/enum.mjs +0 -77
- package/esm/packages/seal/src/rules/common/enum.mjs.map +0 -1
- package/esm/packages/seal/src/rules/common/equals-field-rules.mjs +0 -42
- package/esm/packages/seal/src/rules/common/equals-field-rules.mjs.map +0 -1
- package/esm/packages/seal/src/rules/common/index.mjs +0 -8
- package/esm/packages/seal/src/rules/common/instanceof.mjs +0 -23
- package/esm/packages/seal/src/rules/common/instanceof.mjs.map +0 -1
- package/esm/packages/seal/src/rules/common/literal.mjs +0 -31
- package/esm/packages/seal/src/rules/common/literal.mjs.map +0 -1
- package/esm/packages/seal/src/rules/common/type-rules.mjs +0 -97
- package/esm/packages/seal/src/rules/common/type-rules.mjs.map +0 -1
- package/esm/packages/seal/src/rules/common/unknown-key.mjs +0 -25
- package/esm/packages/seal/src/rules/common/unknown-key.mjs.map +0 -1
- package/esm/packages/seal/src/rules/conditional/forbidden-if-rules.mjs +0 -116
- package/esm/packages/seal/src/rules/conditional/forbidden-if-rules.mjs.map +0 -1
- package/esm/packages/seal/src/rules/conditional/index.mjs +0 -12
- package/esm/packages/seal/src/rules/conditional/present-if-rules.mjs +0 -97
- package/esm/packages/seal/src/rules/conditional/present-if-rules.mjs.map +0 -1
- package/esm/packages/seal/src/rules/conditional/present-unless-rules.mjs +0 -30
- package/esm/packages/seal/src/rules/conditional/present-unless-rules.mjs.map +0 -1
- package/esm/packages/seal/src/rules/conditional/present-with-rules.mjs +0 -76
- package/esm/packages/seal/src/rules/conditional/present-with-rules.mjs.map +0 -1
- package/esm/packages/seal/src/rules/conditional/present-without-rules.mjs +0 -76
- package/esm/packages/seal/src/rules/conditional/present-without-rules.mjs.map +0 -1
- package/esm/packages/seal/src/rules/conditional/required-if-rules.mjs +0 -204
- package/esm/packages/seal/src/rules/conditional/required-if-rules.mjs.map +0 -1
- package/esm/packages/seal/src/rules/conditional/required-unless-rules.mjs +0 -31
- package/esm/packages/seal/src/rules/conditional/required-unless-rules.mjs.map +0 -1
- package/esm/packages/seal/src/rules/conditional/required-when-rule.mjs +0 -32
- package/esm/packages/seal/src/rules/conditional/required-when-rule.mjs.map +0 -1
- package/esm/packages/seal/src/rules/conditional/required-with-rules.mjs +0 -67
- package/esm/packages/seal/src/rules/conditional/required-with-rules.mjs.map +0 -1
- package/esm/packages/seal/src/rules/conditional/required-without-rules.mjs +0 -67
- package/esm/packages/seal/src/rules/conditional/required-without-rules.mjs.map +0 -1
- package/esm/packages/seal/src/rules/core/equal.mjs +0 -22
- package/esm/packages/seal/src/rules/core/equal.mjs.map +0 -1
- package/esm/packages/seal/src/rules/core/forbidden.mjs +0 -20
- package/esm/packages/seal/src/rules/core/forbidden.mjs.map +0 -1
- package/esm/packages/seal/src/rules/core/index.mjs +0 -7
- package/esm/packages/seal/src/rules/core/required.mjs +0 -36
- package/esm/packages/seal/src/rules/core/required.mjs.map +0 -1
- package/esm/packages/seal/src/rules/core/union.mjs +0 -32
- package/esm/packages/seal/src/rules/core/union.mjs.map +0 -1
- package/esm/packages/seal/src/rules/core/when.mjs +0 -37
- package/esm/packages/seal/src/rules/core/when.mjs.map +0 -1
- package/esm/packages/seal/src/rules/date/date-comparison-rules.mjs +0 -78
- package/esm/packages/seal/src/rules/date/date-comparison-rules.mjs.map +0 -1
- package/esm/packages/seal/src/rules/date/date-day-rules.mjs +0 -49
- package/esm/packages/seal/src/rules/date/date-day-rules.mjs.map +0 -1
- package/esm/packages/seal/src/rules/date/date-field-comparison-rules.mjs +0 -82
- package/esm/packages/seal/src/rules/date/date-field-comparison-rules.mjs.map +0 -1
- package/esm/packages/seal/src/rules/date/date-period-rules.mjs +0 -401
- package/esm/packages/seal/src/rules/date/date-period-rules.mjs.map +0 -1
- package/esm/packages/seal/src/rules/date/date-relative-rules.mjs +0 -55
- package/esm/packages/seal/src/rules/date/date-relative-rules.mjs.map +0 -1
- package/esm/packages/seal/src/rules/date/date-special-rules.mjs +0 -58
- package/esm/packages/seal/src/rules/date/date-special-rules.mjs.map +0 -1
- package/esm/packages/seal/src/rules/date/date.mjs +0 -235
- package/esm/packages/seal/src/rules/date/date.mjs.map +0 -1
- package/esm/packages/seal/src/rules/date/index.mjs +0 -9
- package/esm/packages/seal/src/rules/file/dimensions.mjs +0 -3
- package/esm/packages/seal/src/rules/file/file-size.mjs +0 -3
- package/esm/packages/seal/src/rules/file/index.mjs +0 -4
- package/esm/packages/seal/src/rules/index.mjs +0 -54
- package/esm/packages/seal/src/rules/length/index.mjs +0 -3
- package/esm/packages/seal/src/rules/length/length-rules.mjs +0 -98
- package/esm/packages/seal/src/rules/length/length-rules.mjs.map +0 -1
- package/esm/packages/seal/src/rules/number/index.mjs +0 -3
- package/esm/packages/seal/src/rules/number/number-rules.mjs +0 -197
- package/esm/packages/seal/src/rules/number/number-rules.mjs.map +0 -1
- package/esm/packages/seal/src/rules/scalar/accepted-rule.mjs +0 -123
- package/esm/packages/seal/src/rules/scalar/accepted-rule.mjs.map +0 -1
- package/esm/packages/seal/src/rules/scalar/declined-rule.mjs +0 -123
- package/esm/packages/seal/src/rules/scalar/declined-rule.mjs.map +0 -1
- package/esm/packages/seal/src/rules/scalar/index.mjs +0 -4
- package/esm/packages/seal/src/rules/string/alpha.mjs +0 -41
- package/esm/packages/seal/src/rules/string/alpha.mjs.map +0 -1
- package/esm/packages/seal/src/rules/string/credit-card.mjs +0 -32
- package/esm/packages/seal/src/rules/string/credit-card.mjs.map +0 -1
- package/esm/packages/seal/src/rules/string/email.mjs +0 -20
- package/esm/packages/seal/src/rules/string/email.mjs.map +0 -1
- package/esm/packages/seal/src/rules/string/id-formats.mjs +0 -104
- package/esm/packages/seal/src/rules/string/id-formats.mjs.map +0 -1
- package/esm/packages/seal/src/rules/string/index.mjs +0 -13
- package/esm/packages/seal/src/rules/string/ip.mjs +0 -66
- package/esm/packages/seal/src/rules/string/ip.mjs.map +0 -1
- package/esm/packages/seal/src/rules/string/matches.mjs +0 -4
- package/esm/packages/seal/src/rules/string/pattern.mjs +0 -20
- package/esm/packages/seal/src/rules/string/pattern.mjs.map +0 -1
- package/esm/packages/seal/src/rules/string/string-comparison.mjs +0 -56
- package/esm/packages/seal/src/rules/string/string-comparison.mjs.map +0 -1
- package/esm/packages/seal/src/rules/string/strong-password-rule.mjs +0 -31
- package/esm/packages/seal/src/rules/string/strong-password-rule.mjs.map +0 -1
- package/esm/packages/seal/src/rules/string/url.mjs +0 -23
- package/esm/packages/seal/src/rules/string/url.mjs.map +0 -1
- package/esm/packages/seal/src/rules/string/without-whitespace.mjs +0 -19
- package/esm/packages/seal/src/rules/string/without-whitespace.mjs.map +0 -1
- package/esm/packages/seal/src/standard-schema/json-schema.mjs +0 -81
- package/esm/packages/seal/src/standard-schema/json-schema.mjs.map +0 -1
- package/esm/packages/seal/src/standard-schema/map-result.mjs +0 -26
- package/esm/packages/seal/src/standard-schema/map-result.mjs.map +0 -1
- package/esm/packages/seal/src/string.mjs +0 -13
- package/esm/packages/seal/src/string.mjs.map +0 -1
- package/esm/packages/seal/src/types/date-types.mjs +0 -17
- package/esm/packages/seal/src/types/date-types.mjs.map +0 -1
- package/esm/packages/seal/src/validators/any-validator.mjs +0 -38
- package/esm/packages/seal/src/validators/any-validator.mjs.map +0 -1
- package/esm/packages/seal/src/validators/array-validator.mjs +0 -186
- package/esm/packages/seal/src/validators/array-validator.mjs.map +0 -1
- package/esm/packages/seal/src/validators/base-validator.mjs +0 -720
- package/esm/packages/seal/src/validators/base-validator.mjs.map +0 -1
- package/esm/packages/seal/src/validators/boolean-validator.mjs +0 -175
- package/esm/packages/seal/src/validators/boolean-validator.mjs.map +0 -1
- package/esm/packages/seal/src/validators/computed-validator.mjs +0 -118
- package/esm/packages/seal/src/validators/computed-validator.mjs.map +0 -1
- package/esm/packages/seal/src/validators/date-validator.mjs +0 -640
- package/esm/packages/seal/src/validators/date-validator.mjs.map +0 -1
- package/esm/packages/seal/src/validators/discriminated-union-validator.mjs +0 -138
- package/esm/packages/seal/src/validators/discriminated-union-validator.mjs.map +0 -1
- package/esm/packages/seal/src/validators/float-validator.mjs +0 -18
- package/esm/packages/seal/src/validators/float-validator.mjs.map +0 -1
- package/esm/packages/seal/src/validators/index.mjs +0 -28
- package/esm/packages/seal/src/validators/instanceof-validator.mjs +0 -64
- package/esm/packages/seal/src/validators/instanceof-validator.mjs.map +0 -1
- package/esm/packages/seal/src/validators/int-validator.mjs +0 -30
- package/esm/packages/seal/src/validators/int-validator.mjs.map +0 -1
- package/esm/packages/seal/src/validators/lazy-validator.mjs +0 -87
- package/esm/packages/seal/src/validators/lazy-validator.mjs.map +0 -1
- package/esm/packages/seal/src/validators/literal-validator.mjs +0 -72
- package/esm/packages/seal/src/validators/literal-validator.mjs.map +0 -1
- package/esm/packages/seal/src/validators/managed-validator.mjs +0 -39
- package/esm/packages/seal/src/validators/managed-validator.mjs.map +0 -1
- package/esm/packages/seal/src/validators/methods/equality-conditional-methods.mjs +0 -129
- package/esm/packages/seal/src/validators/methods/equality-conditional-methods.mjs.map +0 -1
- package/esm/packages/seal/src/validators/methods/forbidden-methods.mjs +0 -131
- package/esm/packages/seal/src/validators/methods/forbidden-methods.mjs.map +0 -1
- package/esm/packages/seal/src/validators/methods/present-methods.mjs +0 -235
- package/esm/packages/seal/src/validators/methods/present-methods.mjs.map +0 -1
- package/esm/packages/seal/src/validators/methods/required-methods.mjs +0 -347
- package/esm/packages/seal/src/validators/methods/required-methods.mjs.map +0 -1
- package/esm/packages/seal/src/validators/number-validator.mjs +0 -331
- package/esm/packages/seal/src/validators/number-validator.mjs.map +0 -1
- package/esm/packages/seal/src/validators/numeric-validator.mjs +0 -27
- package/esm/packages/seal/src/validators/numeric-validator.mjs.map +0 -1
- package/esm/packages/seal/src/validators/object-validator.mjs +0 -445
- package/esm/packages/seal/src/validators/object-validator.mjs.map +0 -1
- package/esm/packages/seal/src/validators/primitive-validator.mjs +0 -88
- package/esm/packages/seal/src/validators/primitive-validator.mjs.map +0 -1
- package/esm/packages/seal/src/validators/record-validator.mjs +0 -112
- package/esm/packages/seal/src/validators/record-validator.mjs.map +0 -1
- package/esm/packages/seal/src/validators/scalar-validator.mjs +0 -173
- package/esm/packages/seal/src/validators/scalar-validator.mjs.map +0 -1
- package/esm/packages/seal/src/validators/string-validator.mjs +0 -459
- package/esm/packages/seal/src/validators/string-validator.mjs.map +0 -1
- package/esm/packages/seal/src/validators/tuple-validator.mjs +0 -134
- package/esm/packages/seal/src/validators/tuple-validator.mjs.map +0 -1
- package/esm/packages/seal/src/validators/union-validator.mjs +0 -66
- package/esm/packages/seal/src/validators/union-validator.mjs.map +0 -1
|
@@ -32,10 +32,14 @@
|
|
|
32
32
|
* Every key is optional; `resolveColumnMap` fills the defaults. Values are the
|
|
33
33
|
* app's real column names (rename-friendly: `readAt: "seen_at"`).
|
|
34
34
|
*/
|
|
35
|
-
type NotificationColumnMap = {
|
|
36
|
-
/** Recipient FK column. Default: `"user_id"`. */
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
export type NotificationColumnMap = {
|
|
36
|
+
/** Recipient FK column. Default: `"user_id"`. */
|
|
37
|
+
recipient?: string;
|
|
38
|
+
/** Multi-tenant scope column, written from the recipient. Omit → single-tenant. */
|
|
39
|
+
tenant?: string;
|
|
40
|
+
/** Read-timestamp column. Present → read-state records "when". */
|
|
41
|
+
readAt?: string;
|
|
42
|
+
/** Read-flag column (indexed → fast unread filter). Present → read-state is a boolean. */
|
|
39
43
|
isRead?: string;
|
|
40
44
|
};
|
|
41
45
|
/**
|
|
@@ -43,14 +47,14 @@ type NotificationColumnMap = {
|
|
|
43
47
|
* set, and at least one of `readAt` / `isRead` is always present (the resolver
|
|
44
48
|
* falls back to `readAt`), so consumers never face a "no read-state" map.
|
|
45
49
|
*/
|
|
46
|
-
type ResolvedNotificationColumnMap = {
|
|
50
|
+
export type ResolvedNotificationColumnMap = {
|
|
47
51
|
recipient: string;
|
|
48
52
|
tenant?: string;
|
|
49
53
|
readAt?: string;
|
|
50
54
|
isRead?: string;
|
|
51
55
|
};
|
|
52
56
|
/** A model class that may carry the `columnMap` static. */
|
|
53
|
-
type NotificationColumnMapHost = {
|
|
57
|
+
export type NotificationColumnMapHost = {
|
|
54
58
|
columnMap?: NotificationColumnMap;
|
|
55
59
|
};
|
|
56
60
|
/**
|
|
@@ -59,7 +63,6 @@ type NotificationColumnMapHost = {
|
|
|
59
63
|
* declares no read-state column. The fallback guarantees the result always
|
|
60
64
|
* has a usable read-state representation, so no boot-time validation is needed.
|
|
61
65
|
*/
|
|
62
|
-
declare function resolveColumnMap(map: NotificationColumnMap | undefined): ResolvedNotificationColumnMap;
|
|
66
|
+
export declare function resolveColumnMap(map: NotificationColumnMap | undefined): ResolvedNotificationColumnMap;
|
|
63
67
|
//#endregion
|
|
64
|
-
export { NotificationColumnMap, NotificationColumnMapHost, ResolvedNotificationColumnMap, resolveColumnMap };
|
|
65
68
|
//# sourceMappingURL=column-map.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"column-map.d.mts","names":[],"sources":["../../../../../../../../packages/notifications/src/in-app/column-map.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"column-map.d.mts","names":[],"sources":["../../../../../../../../packages/notifications/src/in-app/column-map.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAkCY;;EAEV;;EAEA;;EAEA;;EAEA;;;;;;;YAQU;EACV;EACA;EACA;EACA;;;YAIU;EACV,YAAY;;;;;;;;wBAYE,iBACd,KAAK,oCACJ"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Id } from "../types.mjs";
|
|
2
2
|
import { NotificationContract } from "../contracts/notification.contract.mjs";
|
|
3
|
+
import "../contracts/index.mjs";
|
|
3
4
|
import { NotificationColumnMap, ResolvedNotificationColumnMap } from "./column-map.mjs";
|
|
4
5
|
import { Model } from "@warlock.js/cascade";
|
|
5
|
-
|
|
6
6
|
//#region ../../packages/notifications/src/in-app/database-notification.d.ts
|
|
7
|
-
declare abstract class DatabaseNotification extends Model implements NotificationContract {
|
|
7
|
+
export declare abstract class DatabaseNotification extends Model implements NotificationContract {
|
|
8
8
|
/**
|
|
9
9
|
* Physical column bindings for THIS model's table. Override in the subclass;
|
|
10
10
|
* the empty default resolves to `{ recipient: "user_id", readAt: "read_at" }`.
|
|
@@ -26,5 +26,4 @@ declare abstract class DatabaseNotification extends Model implements Notificatio
|
|
|
26
26
|
markRead(): Promise<void>;
|
|
27
27
|
}
|
|
28
28
|
//#endregion
|
|
29
|
-
export { DatabaseNotification };
|
|
30
29
|
//# sourceMappingURL=database-notification.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"database-notification.d.mts","names":[],"sources":["../../../../../../../../packages/notifications/src/in-app/database-notification.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"database-notification.d.mts","names":[],"sources":["../../../../../../../../packages/notifications/src/in-app/database-notification.ts"],"mappings":";;;;;;8BA6BsB,6BAA6B,iBAAiB;;;;;SAKpD,WAAW;;gBAGX,WAAW;MAId,eAAe;;MAKf,YAAY;MAKZ;MAIA;MAUA,UAAU;;;;;;EAUR,YAAY"}
|
package/esm/in-app/in-app.d.mts
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import { DatabasePayload, Id, Notifiable } from "../types.mjs";
|
|
2
2
|
import { Channel } from "../contracts/channel.contract.mjs";
|
|
3
3
|
import { NotificationContract } from "../contracts/notification.contract.mjs";
|
|
4
|
+
import "../contracts/index.mjs";
|
|
4
5
|
import { BaseNotificationsRepository, NotificationModelClass, NotificationsFilter } from "./base-notifications-repository.mjs";
|
|
6
|
+
import "../index.mjs";
|
|
5
7
|
import { TypedRepositoryOptionsWithPages } from "@warlock.js/core";
|
|
6
|
-
|
|
7
8
|
//#region ../../packages/notifications/src/in-app/in-app.d.ts
|
|
8
9
|
/**
|
|
9
10
|
* List options for the read methods — the repository's paginated options
|
|
10
11
|
* (`page` / `limit` / `orderBy` / filter keys). `recipientId` is always forced
|
|
11
12
|
* from the recipient argument, so passing it here has no effect.
|
|
12
13
|
*/
|
|
13
|
-
type NotificationsListOptions = TypedRepositoryOptionsWithPages<NotificationsFilter>;
|
|
14
|
+
export type NotificationsListOptions = TypedRepositoryOptionsWithPages<NotificationsFilter>;
|
|
14
15
|
/**
|
|
15
16
|
* Configure options — discriminated so `model` and `repository` are mutually
|
|
16
17
|
* exclusive at the type level. Future knobs (cache / realtime / naming) slot
|
|
17
18
|
* in here without breaking the signature.
|
|
18
19
|
*/
|
|
19
|
-
type ConfigureOptions = {
|
|
20
|
+
export type ConfigureOptions = {
|
|
20
21
|
model: NotificationModelClass;
|
|
21
22
|
repository?: never;
|
|
22
23
|
} | {
|
|
@@ -50,7 +51,7 @@ declare class InApp {
|
|
|
50
51
|
dismiss(recipient: Notifiable | Id, id?: Id): Promise<number>;
|
|
51
52
|
}
|
|
52
53
|
/** Single in-app facade — bound at boot via `inApp.configure(...)`. */
|
|
53
|
-
declare const inApp: InApp;
|
|
54
|
+
export declare const inApp: InApp;
|
|
54
55
|
//#endregion
|
|
55
|
-
export {
|
|
56
|
+
export {};
|
|
56
57
|
//# sourceMappingURL=in-app.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"in-app.d.mts","names":[],"sources":["../../../../../../../../packages/notifications/src/in-app/in-app.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"in-app.d.mts","names":["_$__0.NotificationContract"],"sources":["../../../../../../../../packages/notifications/src/in-app/in-app.ts"],"mappings":";;;;;;;;;;;;;YA4CY,2BAA2B,gCAAgC;;;;;;YAO3D;EACN,OAAO;EAAwB;;EAC/B,YAAY;EAA6B;;cAKzC;UACI;;;;;EAMD,UAAU,SAAS,mBAAmB,QAAQ;cAQzC;;EAWL,KAAK,WAAW,aAAa,IAAI,UAAU,2BAAwB,mCAAA,iBAAxBA;;EAK3C,WAAW,WAAW,aAAa,IAAI,UAAU,2BAAwB,mCAAA,iBAAxBA;;;;;EAQjD,YAAY,WAAW,aAAa,KAAE;;EAKtC,KAAK,WAAW,aAAa,IAAI,IAAI,KAAE,QAAFA;;EAKrC,WAAW,WAAW,aAAa,IAAI,KAAK,KAAE;;EAK9C,aAAa,WAAW,aAAa,IAAI,KAAK,KAAE;;EAKhD,QAAQ,WAAW,aAAa,IAAI,KAAK,KAAE;;;qBAMvC,OAAK"}
|
package/esm/in-app/index.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { NotificationColumnMap, NotificationColumnMapHost, ResolvedNotificationColumnMap, resolveColumnMap } from "./column-map.mjs";
|
|
2
2
|
import { DatabaseNotification } from "./database-notification.mjs";
|
|
3
3
|
import { BaseNotificationsRepository, NotificationModelClass, NotificationsFilter } from "./base-notifications-repository.mjs";
|
|
4
|
-
import { ConfigureOptions, NotificationsListOptions, inApp } from "./in-app.mjs";
|
|
4
|
+
import { ConfigureOptions, NotificationsListOptions, inApp } from "./in-app.mjs";
|
|
5
|
+
export { BaseNotificationsRepository, ConfigureOptions, DatabaseNotification, NotificationColumnMap, NotificationColumnMapHost, NotificationModelClass, NotificationsFilter, NotificationsListOptions, ResolvedNotificationColumnMap, inApp, resolveColumnMap };
|
package/esm/in-app/index.mjs
CHANGED
|
@@ -3,4 +3,4 @@ import { BaseNotificationsRepository } from "./base-notifications-repository.mjs
|
|
|
3
3
|
import { DatabaseNotification } from "./database-notification.mjs";
|
|
4
4
|
import { inApp } from "./in-app.mjs";
|
|
5
5
|
|
|
6
|
-
export {
|
|
6
|
+
export { BaseNotificationsRepository, DatabaseNotification, inApp, resolveColumnMap };
|
package/esm/index.d.mts
CHANGED
|
@@ -4,25 +4,31 @@ import { NotificationContract } from "./contracts/notification.contract.mjs";
|
|
|
4
4
|
import { PreferenceProvider } from "./contracts/preference-provider.contract.mjs";
|
|
5
5
|
import { QueueDispatcher } from "./contracts/queue-dispatcher.contract.mjs";
|
|
6
6
|
import { RateLimiter } from "./contracts/rate-limiter.contract.mjs";
|
|
7
|
+
import "./contracts/index.mjs";
|
|
7
8
|
import { ChannelNotFoundError, MissingRendererError, NoQueueDispatcherError, NotificationsNotConfiguredError, UnresolvableRouteError } from "./errors.mjs";
|
|
8
9
|
import { ChannelMap, NotificationConfig, getNotificationConfig, resetNotificationConfig, setNotificationConfig } from "./config.mjs";
|
|
9
10
|
import { defineChannel } from "./dispatch/define-channel.mjs";
|
|
10
11
|
import { DefinedNotification, NotificationDef, defineNotification } from "./dispatch/define-notification.mjs";
|
|
11
12
|
import { Notify, notify } from "./dispatch/notify.mjs";
|
|
12
13
|
import { notifications } from "./dispatch/notifications-event-bus.mjs";
|
|
14
|
+
import "./dispatch/index.mjs";
|
|
13
15
|
import { NotificationColumnMap, NotificationColumnMapHost, ResolvedNotificationColumnMap, resolveColumnMap } from "./in-app/column-map.mjs";
|
|
14
16
|
import { DatabaseNotification } from "./in-app/database-notification.mjs";
|
|
15
17
|
import { BaseNotificationsRepository, NotificationModelClass, NotificationsFilter } from "./in-app/base-notifications-repository.mjs";
|
|
16
18
|
import { databaseChannel } from "./channels/database-channel.mjs";
|
|
17
19
|
import { MailChannelConfig, mailChannel } from "./channels/mail-channel.mjs";
|
|
20
|
+
import "./channels/index.mjs";
|
|
18
21
|
import { ConfigureOptions, NotificationsListOptions, inApp } from "./in-app/in-app.mjs";
|
|
22
|
+
import "./in-app/index.mjs";
|
|
19
23
|
import { NotificationColumnsOptions, NotificationIdType, notificationColumns } from "./migration/notification-columns.mjs";
|
|
24
|
+
import "./migration/index.mjs";
|
|
20
25
|
import { HeraldQueueOptions, heraldQueue } from "./queue/herald-queue.mjs";
|
|
21
26
|
import { WorkerOptions, startNotificationsWorker } from "./queue/notifications-worker.mjs";
|
|
22
27
|
import { DEFAULT_QUEUE_CHANNEL } from "./queue/load-herald.mjs";
|
|
23
28
|
import { BullmqQueueOptions, NOTIFICATION_JOB_NAME, bullmqQueue } from "./queue/bullmq-queue.mjs";
|
|
24
29
|
import { QueuePackageLoader, loadQueuePackage } from "./queue/load-queue.mjs";
|
|
25
30
|
import { QueuePackageNotInstalledError } from "./queue/queue-package-not-installed.error.mjs";
|
|
31
|
+
import "./queue/index.mjs";
|
|
26
32
|
export { BaseNotificationsRepository, BullmqQueueOptions, Channel, ChannelMap, ChannelName, ChannelNotFoundError, ConfigureOptions, DEFAULT_QUEUE_CHANNEL, DatabaseNotification, DatabasePayload, DefinedNotification, HeraldQueueOptions, Id, MailChannelConfig, MailPayload, MissingRendererError, NOTIFICATION_JOB_NAME, NoQueueDispatcherError, Notifiable, NotificationChannels, NotificationColumnMap, NotificationColumnMapHost, NotificationColumnsOptions, NotificationConfig, NotificationContract, NotificationDef, NotificationEvents, NotificationIdType, NotificationInput, NotificationModelClass, NotificationsFilter, NotificationsListOptions, NotificationsNotConfiguredError, Notify, PreferenceProvider, QueueDispatcher, type QueuePackageLoader, QueuePackageNotInstalledError, RateLimiter, RenderContext, ResolvedNotificationColumnMap, SendOptions, UnresolvableRouteError, WorkerOptions, bullmqQueue, databaseChannel, defineChannel, defineNotification, getNotificationConfig, heraldQueue, inApp, loadQueuePackage, mailChannel, notificationColumns, notifications, notify, resetNotificationConfig, resolveColumnMap, setNotificationConfig, startNotificationsWorker };
|
|
27
33
|
import "./dispatch/define-channel.mjs";
|
|
28
34
|
import "./types.mjs";
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import { NotificationColumnsOptions, NotificationIdType, notificationColumns } from "./notification-columns.mjs";
|
|
1
|
+
import { NotificationColumnsOptions, NotificationIdType, notificationColumns } from "./notification-columns.mjs";
|
|
2
|
+
export { NotificationColumnsOptions, NotificationIdType, notificationColumns };
|
package/esm/migration/index.mjs
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import { NotificationColumnMapHost } from "../in-app/column-map.mjs";
|
|
2
2
|
import { ColumnMap } from "@warlock.js/cascade";
|
|
3
|
-
|
|
4
3
|
//#region ../../packages/notifications/src/migration/notification-columns.d.ts
|
|
5
|
-
type NotificationIdType = "uuid" | "bigint" | "integer" | "string";
|
|
6
|
-
type NotificationColumnsOptions = {
|
|
7
|
-
/** The type used for recipient and tenant identifiers. Defaults to UUID. */
|
|
4
|
+
export type NotificationIdType = "uuid" | "bigint" | "integer" | "string";
|
|
5
|
+
export type NotificationColumnsOptions = {
|
|
6
|
+
/** The type used for recipient and tenant identifiers. Defaults to UUID. */
|
|
7
|
+
idType?: NotificationIdType;
|
|
8
8
|
};
|
|
9
9
|
/**
|
|
10
10
|
* Returns the column map for a notification table, named from the model's
|
|
11
11
|
* `columnMap`. Without a model, falls back to the resolved defaults
|
|
12
12
|
* (`user_id` recipient + `read_at` read-state).
|
|
13
13
|
*/
|
|
14
|
-
declare function notificationColumns(options?: NotificationColumnsOptions): ColumnMap;
|
|
15
|
-
declare function notificationColumns(model?: NotificationColumnMapHost, options?: NotificationColumnsOptions): ColumnMap;
|
|
14
|
+
export declare function notificationColumns(options?: NotificationColumnsOptions): ColumnMap;
|
|
15
|
+
export declare function notificationColumns(model?: NotificationColumnMapHost, options?: NotificationColumnsOptions): ColumnMap;
|
|
16
16
|
//#endregion
|
|
17
|
-
export { NotificationColumnsOptions, NotificationIdType, notificationColumns };
|
|
18
17
|
//# sourceMappingURL=notification-columns.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification-columns.d.mts","names":[],"sources":["../../../../../../../../packages/notifications/src/migration/notification-columns.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"notification-columns.d.mts","names":[],"sources":["../../../../../../../../packages/notifications/src/migration/notification-columns.ts"],"mappings":";;;YAsCY;YAEA;;EAEV,SAAS;;;;;;;wBAQK,oBAAoB,UAAU,6BAA6B;wBAC3D,oBACd,QAAQ,2BACR,UAAU,6BACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification-columns.mjs","names":[],"sources":["../../../../../../../../packages/notifications/src/migration/notification-columns.ts"],"sourcesContent":["/**\n * Column factory for the notifications table, driven by the model's\n * `columnMap`. The recipient / read-state / tenant columns take the NAMES the\n * model declares, so the table, the repository, and the model accessors all\n * agree by construction. The stable lexical columns (`type`, `title`, `body`,\n * `payload`, `idempotency_key`) keep fixed names.\n *\n * Read-state follows the map's presence rules (see `NotificationColumnMap`):\n * `readAt` → a nullable timestamp, `isRead` → an indexed boolean, both → both.\n *\n * Spread + extend for app-specific extras (FK references, composite indexes).\n *\n * @example\n * import { Migration } from \"@warlock.js/cascade\";\n * import { notificationColumns } from \"@warlock.js/notifications\";\n * import { Notification } from \"../notification.model\";\n *\n * export default Migration.create(Notification, notificationColumns(Notification));\n *\n * @example // with extras (multi-tenant FK)\n * export default Migration.create(Notification, {\n * ...notificationColumns(Notification),\n * organization_id: uuid().references(Organization.table).notNullable(),\n * });\n */\nimport {
|
|
1
|
+
{"version":3,"file":"notification-columns.mjs","names":[],"sources":["../../../../../../../../packages/notifications/src/migration/notification-columns.ts"],"sourcesContent":["/**\n * Column factory for the notifications table, driven by the model's\n * `columnMap`. The recipient / read-state / tenant columns take the NAMES the\n * model declares, so the table, the repository, and the model accessors all\n * agree by construction. The stable lexical columns (`type`, `title`, `body`,\n * `payload`, `idempotency_key`) keep fixed names.\n *\n * Read-state follows the map's presence rules (see `NotificationColumnMap`):\n * `readAt` → a nullable timestamp, `isRead` → an indexed boolean, both → both.\n *\n * Spread + extend for app-specific extras (FK references, composite indexes).\n *\n * @example\n * import { Migration } from \"@warlock.js/cascade\";\n * import { notificationColumns } from \"@warlock.js/notifications\";\n * import { Notification } from \"../notification.model\";\n *\n * export default Migration.create(Notification, notificationColumns(Notification));\n *\n * @example // with extras (multi-tenant FK)\n * export default Migration.create(Notification, {\n * ...notificationColumns(Notification),\n * organization_id: uuid().references(Organization.table).notNullable(),\n * });\n */\nimport {\n bigInteger,\n boolCol,\n type ColumnMap,\n integer,\n json,\n string,\n text,\n timestamp,\n uuid,\n} from \"@warlock.js/cascade\";\nimport { type NotificationColumnMapHost, resolveColumnMap } from \"../in-app/column-map\";\n\nexport type NotificationIdType = \"uuid\" | \"bigint\" | \"integer\" | \"string\";\n\nexport type NotificationColumnsOptions = {\n /** The type used for recipient and tenant identifiers. Defaults to UUID. */\n idType?: NotificationIdType;\n};\n\n/**\n * Returns the column map for a notification table, named from the model's\n * `columnMap`. Without a model, falls back to the resolved defaults\n * (`user_id` recipient + `read_at` read-state).\n */\nexport function notificationColumns(options?: NotificationColumnsOptions): ColumnMap;\nexport function notificationColumns(\n model?: NotificationColumnMapHost,\n options?: NotificationColumnsOptions,\n): ColumnMap;\nexport function notificationColumns(\n modelOrOptions?: NotificationColumnMapHost | NotificationColumnsOptions,\n options?: NotificationColumnsOptions,\n): ColumnMap {\n const model = isNotificationColumnsOptions(modelOrOptions) ? undefined : modelOrOptions;\n const idType =\n (isNotificationColumnsOptions(modelOrOptions) ? modelOrOptions : options)?.idType ?? \"uuid\";\n const { recipient, tenant, readAt, isRead } = resolveColumnMap(model?.columnMap);\n const idColumn = getIdColumn(idType);\n\n const columns: ColumnMap = {\n [recipient]: idColumn().index().notNullable(),\n type: string().index().notNullable(),\n title: string().notNullable(),\n body: text().nullable(),\n payload: json().nullable(),\n };\n\n if (readAt) {\n columns[readAt] = timestamp().nullable();\n }\n\n if (isRead) {\n columns[isRead] = boolCol().default(false).index();\n }\n\n if (tenant) {\n columns[tenant] = idColumn().index().notNullable();\n }\n\n // Unique so a retried send can't insert a duplicate. Nullable: most rows\n // have no key (NULLs are distinct in a unique index). `createFor` does\n // find-or-create; this constraint is the race backstop.\n columns.idempotency_key = string().nullable().unique();\n\n return columns;\n}\n\nfunction isNotificationColumnsOptions(\n value: NotificationColumnMapHost | NotificationColumnsOptions | undefined,\n): value is NotificationColumnsOptions {\n return \"idType\" in (value ?? {});\n}\n\nfunction getIdColumn(idType: NotificationIdType) {\n switch (idType) {\n case \"bigint\":\n return bigInteger;\n case \"integer\":\n return integer;\n case \"string\":\n return string;\n default:\n return uuid;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuDA,SAAgB,oBACd,gBACA,SACW;CACX,MAAM,QAAQ,6BAA6B,cAAc,IAAI,SAAY;CACzE,MAAM,UACH,6BAA6B,cAAc,IAAI,iBAAiB,QAAO,EAAG,UAAU;CACvF,MAAM,EAAE,WAAW,QAAQ,QAAQ,WAAW,iBAAiB,OAAO,SAAS;CAC/E,MAAM,WAAW,YAAY,MAAM;CAEnC,MAAM,UAAqB;GACxB,YAAY,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,YAAY;EAC5C,MAAM,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,YAAY;EACnC,OAAO,OAAO,CAAC,CAAC,YAAY;EAC5B,MAAM,KAAK,CAAC,CAAC,SAAS;EACtB,SAAS,KAAK,CAAC,CAAC,SAAS;CAC3B;CAEA,IAAI,QACF,QAAQ,UAAU,UAAU,CAAC,CAAC,SAAS;CAGzC,IAAI,QACF,QAAQ,UAAU,QAAQ,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,MAAM;CAGnD,IAAI,QACF,QAAQ,UAAU,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,YAAY;CAMnD,QAAQ,kBAAkB,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO;CAErD,OAAO;AACT;AAEA,SAAS,6BACP,OACqC;CACrC,OAAO,aAAa,SAAS,CAAC;AAChC;AAEA,SAAS,YAAY,QAA4B;CAC/C,QAAQ,QAAR;EACE,KAAK,UACH,OAAO;EACT,KAAK,WACH,OAAO;EACT,KAAK,UACH,OAAO;EACT,SACE,OAAO;CACX;AACF"}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { QueueDispatcher } from "../contracts/queue-dispatcher.contract.mjs";
|
|
2
|
+
import "../contracts/index.mjs";
|
|
2
3
|
import { JobBackoff } from "@warlock.js/queue";
|
|
3
|
-
|
|
4
4
|
//#region ../../packages/notifications/src/queue/bullmq-queue.d.ts
|
|
5
5
|
/** The job name notification deliveries run under. */
|
|
6
|
-
declare const NOTIFICATION_JOB_NAME = "warlock.notifications.deliver";
|
|
7
|
-
type BullmqQueueOptions = {
|
|
8
|
-
/** Queue to deliver on. Default: `@warlock.js/queue`'s default queue. */
|
|
9
|
-
|
|
6
|
+
export declare const NOTIFICATION_JOB_NAME = "warlock.notifications.deliver";
|
|
7
|
+
export type BullmqQueueOptions = {
|
|
8
|
+
/** Queue to deliver on. Default: `@warlock.js/queue`'s default queue. */
|
|
9
|
+
queue?: string;
|
|
10
|
+
/** Attempts per delivery. Default: `queue.defaultJobOptions.attempts`, else `1`. */
|
|
11
|
+
attempts?: number;
|
|
12
|
+
/** Backoff between attempts. */
|
|
10
13
|
backoff?: JobBackoff;
|
|
11
14
|
};
|
|
12
15
|
/**
|
|
@@ -19,7 +22,6 @@ type BullmqQueueOptions = {
|
|
|
19
22
|
* - A channel missing from the worker's notifications config throws — the
|
|
20
23
|
* delivery is retried per `attempts` / `backoff` like any other failure.
|
|
21
24
|
*/
|
|
22
|
-
declare function bullmqQueue(options: BullmqQueueOptions): QueueDispatcher;
|
|
25
|
+
export declare function bullmqQueue(options: BullmqQueueOptions): QueueDispatcher;
|
|
23
26
|
//#endregion
|
|
24
|
-
export { BullmqQueueOptions, NOTIFICATION_JOB_NAME, bullmqQueue };
|
|
25
27
|
//# sourceMappingURL=bullmq-queue.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bullmq-queue.d.mts","names":[],"sources":["../../../../../../../../packages/notifications/src/queue/bullmq-queue.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"bullmq-queue.d.mts","names":[],"sources":["../../../../../../../../packages/notifications/src/queue/bullmq-queue.ts"],"mappings":";;;;;qBA8Ba;YAED;;EAEV;;EAEA;;EAEA,UAAU;;;;;;;;;;;;wBAoBI,YAAY,SAAS,qBAAqB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bullmq-queue.mjs","names":[],"sources":["../../../../../../../../packages/notifications/src/queue/bullmq-queue.ts"],"sourcesContent":["/**\n * BullMQ-backed `QueueDispatcher` — an alternative to `heraldQueue()` for apps\n * that already run `@warlock.js/queue` and would rather deliver notifications\n * through it than stand up a herald broker.\n *\n * `defineNotification` renders the payload + resolves the route BEFORE\n * handing a job to the dispatcher, so the job (`{ channel, route, payload,\n * options }`) is plain JSON — the same contract `heraldQueue` relies on.\n *\n * `@warlock.js/queue` is an OPTIONAL peer, lazy-loaded via `loadQueuePackage`\n * on first `.dispatch()` — never at import time — so notifications never pays\n * for `@warlock.js/queue` unless `bullmqQueue()` is actually configured.\n *\n * @example src/config/notifications.ts — declarative; the connector registers it\n * import { type NotificationConfig, bullmqQueue, mailChannel } from \"@warlock.js/notifications\";\n *\n * const config: NotificationConfig = {\n * channels: { mail: mailChannel() },\n * queue: bullmqQueue({ attempts: 3, backoff: { type: \"exponential\", delay: 5000 } }),\n * };\n *\n * export default config;\n */\nimport type { JobBackoff } from \"@warlock.js/queue\";\nimport type { QueueDispatcher } from \"../contracts\";\nimport { getNotificationConfig } from \"../config\";\nimport type { ChannelName, SendOptions } from \"../types\";\nimport { loadQueuePackage } from \"./load-queue\";\n\n/** The job name notification deliveries run under. */\nexport const NOTIFICATION_JOB_NAME = \"warlock.notifications.deliver\";\n\nexport type BullmqQueueOptions = {\n /** Queue to deliver on. Default: `@warlock.js/queue`'s default queue. */\n queue?: string;\n /** Attempts per delivery. Default: `queue.defaultJobOptions.attempts`, else `1`. */\n attempts?: number;\n /** Backoff between attempts. */\n backoff?: JobBackoff;\n};\n\ntype NotificationJobPayload = {\n channel: string;\n route: unknown;\n payload: unknown;\n options: SendOptions;\n};\n\n/**\n * Create the `QueueDispatcher` for `NotificationConfig.queue` backed by\n * `@warlock.js/queue`.\n *\n * - `SendOptions.delay` is honoured: a number is SECONDS (notifications'\n * convention), a string is a duration such as `\"10m\"` (`@warlock.js/queue`'s\n * convention).\n * - A channel missing from the worker's notifications config throws — the\n * delivery is retried per `attempts` / `backoff` like any other failure.\n */\nexport function bullmqQueue(options: BullmqQueueOptions): QueueDispatcher {\n let jobPromise: ReturnType<typeof defineNotificationJob> | undefined;\n\n return {\n async dispatch(job) {\n if (!jobPromise) {\n jobPromise = defineNotificationJob(options);\n }\n\n const notificationJob = await jobPromise;\n\n await notificationJob.dispatch(\n { channel: job.channel, route: job.route, payload: job.payload, options: job.options },\n {
|
|
1
|
+
{"version":3,"file":"bullmq-queue.mjs","names":[],"sources":["../../../../../../../../packages/notifications/src/queue/bullmq-queue.ts"],"sourcesContent":["/**\n * BullMQ-backed `QueueDispatcher` — an alternative to `heraldQueue()` for apps\n * that already run `@warlock.js/queue` and would rather deliver notifications\n * through it than stand up a herald broker.\n *\n * `defineNotification` renders the payload + resolves the route BEFORE\n * handing a job to the dispatcher, so the job (`{ channel, route, payload,\n * options }`) is plain JSON — the same contract `heraldQueue` relies on.\n *\n * `@warlock.js/queue` is an OPTIONAL peer, lazy-loaded via `loadQueuePackage`\n * on first `.dispatch()` — never at import time — so notifications never pays\n * for `@warlock.js/queue` unless `bullmqQueue()` is actually configured.\n *\n * @example src/config/notifications.ts — declarative; the connector registers it\n * import { type NotificationConfig, bullmqQueue, mailChannel } from \"@warlock.js/notifications\";\n *\n * const config: NotificationConfig = {\n * channels: { mail: mailChannel() },\n * queue: bullmqQueue({ attempts: 3, backoff: { type: \"exponential\", delay: 5000 } }),\n * };\n *\n * export default config;\n */\nimport type { JobBackoff } from \"@warlock.js/queue\";\nimport type { QueueDispatcher } from \"../contracts\";\nimport { getNotificationConfig } from \"../config\";\nimport type { ChannelName, SendOptions } from \"../types\";\nimport { loadQueuePackage } from \"./load-queue\";\n\n/** The job name notification deliveries run under. */\nexport const NOTIFICATION_JOB_NAME = \"warlock.notifications.deliver\";\n\nexport type BullmqQueueOptions = {\n /** Queue to deliver on. Default: `@warlock.js/queue`'s default queue. */\n queue?: string;\n /** Attempts per delivery. Default: `queue.defaultJobOptions.attempts`, else `1`. */\n attempts?: number;\n /** Backoff between attempts. */\n backoff?: JobBackoff;\n};\n\ntype NotificationJobPayload = {\n channel: string;\n route: unknown;\n payload: unknown;\n options: SendOptions;\n};\n\n/**\n * Create the `QueueDispatcher` for `NotificationConfig.queue` backed by\n * `@warlock.js/queue`.\n *\n * - `SendOptions.delay` is honoured: a number is SECONDS (notifications'\n * convention), a string is a duration such as `\"10m\"` (`@warlock.js/queue`'s\n * convention).\n * - A channel missing from the worker's notifications config throws — the\n * delivery is retried per `attempts` / `backoff` like any other failure.\n */\nexport function bullmqQueue(options: BullmqQueueOptions): QueueDispatcher {\n let jobPromise: ReturnType<typeof defineNotificationJob> | undefined;\n\n return {\n async dispatch(job) {\n if (!jobPromise) {\n jobPromise = defineNotificationJob(options);\n }\n\n const notificationJob = await jobPromise;\n\n await notificationJob.dispatch(\n { channel: job.channel, route: job.route, payload: job.payload, options: job.options },\n {\n delay: job.options.delay === undefined ? undefined : notificationDelay(job.options.delay),\n },\n );\n },\n };\n}\n\nasync function defineNotificationJob(options: BullmqQueueOptions) {\n const { defineJob } = await loadQueuePackage();\n\n return defineJob<NotificationJobPayload, void>({\n name: NOTIFICATION_JOB_NAME,\n queue: options.queue,\n attempts: options.attempts,\n backoff: options.backoff,\n async handle(job) {\n const channel = getNotificationConfig().channels[job.channel as ChannelName];\n\n if (!channel) {\n throw new Error(\n `Notification channel \"${job.channel}\" is not configured in this worker's notifications config.`,\n );\n }\n\n await channel.send({ payload: job.payload, route: job.route, options: job.options } as never);\n },\n });\n}\n\nfunction notificationDelay(delay: number | string): number {\n return typeof delay === \"number\" ? delay * 1_000 : toMilliseconds(delay);\n}\n\n// `toMilliseconds` mirrors `@warlock.js/queue`'s duration parser but is\n// inlined here so this file doesn't need a non-lazy import from the optional\n// peer just to convert a string like \"10m\".\nfunction toMilliseconds(value: string): number {\n const units: Record<string, number> = { ms: 1, s: 1_000, m: 60_000, h: 3_600_000, d: 86_400_000 };\n const match = /^(\\d+(?:\\.\\d+)?)(ms|s|m|h|d)$/.exec(value.trim());\n\n if (!match) {\n throw new Error(\n `Invalid duration \"${value}\": expected a number of milliseconds or a string like ` +\n `\"500ms\", \"30s\", \"10m\", \"2h\", \"1d\".`,\n );\n }\n\n return Math.round(Number(match[1]) * units[match[2]!]!);\n}\n"],"mappings":";;;;;AA8BA,MAAa,wBAAwB;;;;;;;;;;;AA4BrC,SAAgB,YAAY,SAA8C;CACxE,IAAI;CAEJ,OAAO,EACL,MAAM,SAAS,KAAK;EAClB,IAAI,CAAC,YACH,aAAa,sBAAsB,OAAO;EAK5C,OAAM,MAFwB,WAET,CAAC,SACpB;GAAE,SAAS,IAAI;GAAS,OAAO,IAAI;GAAO,SAAS,IAAI;GAAS,SAAS,IAAI;EAAQ,GACrF,EACE,OAAO,IAAI,QAAQ,UAAU,SAAY,SAAY,kBAAkB,IAAI,QAAQ,KAAK,EAC1F,CACF;CACF,EACF;AACF;AAEA,eAAe,sBAAsB,SAA6B;CAChE,MAAM,EAAE,cAAc,MAAM,iBAAiB;CAE7C,OAAO,UAAwC;EAC7C,MAAM;EACN,OAAO,QAAQ;EACf,UAAU,QAAQ;EAClB,SAAS,QAAQ;EACjB,MAAM,OAAO,KAAK;GAChB,MAAM,UAAU,sBAAsB,CAAC,CAAC,SAAS,IAAI;GAErD,IAAI,CAAC,SACH,MAAM,IAAI,MACR,yBAAyB,IAAI,QAAQ,2DACvC;GAGF,MAAM,QAAQ,KAAK;IAAE,SAAS,IAAI;IAAS,OAAO,IAAI;IAAO,SAAS,IAAI;GAAQ,CAAU;EAC9F;CACF,CAAC;AACH;AAEA,SAAS,kBAAkB,OAAgC;CACzD,OAAO,OAAO,UAAU,WAAW,QAAQ,MAAQ,eAAe,KAAK;AACzE;AAKA,SAAS,eAAe,OAAuB;CAC7C,MAAM,QAAgC;EAAE,IAAI;EAAG,GAAG;EAAO,GAAG;EAAQ,GAAG;EAAW,GAAG;CAAW;CAChG,MAAM,QAAQ,gCAAgC,KAAK,MAAM,KAAK,CAAC;CAE/D,IAAI,CAAC,OACH,MAAM,IAAI,MACR,qBAAqB,MAAM,yFAE7B;CAGF,OAAO,KAAK,MAAM,OAAO,MAAM,EAAE,IAAI,MAAM,MAAM,GAAK;AACxD"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { QueueDispatcher } from "../contracts/queue-dispatcher.contract.mjs";
|
|
2
|
+
import "../contracts/index.mjs";
|
|
2
3
|
//#region ../../packages/notifications/src/queue/herald-queue.d.ts
|
|
3
|
-
type HeraldQueueOptions = {
|
|
4
|
-
/** Herald channel to publish jobs to. Default `"notifications.dispatch"`. */
|
|
4
|
+
export type HeraldQueueOptions = {
|
|
5
|
+
/** Herald channel to publish jobs to. Default `"notifications.dispatch"`. */
|
|
6
|
+
channel?: string;
|
|
7
|
+
/** Herald broker name (multi-broker setups). Default broker if omitted. */
|
|
5
8
|
broker?: string;
|
|
6
9
|
};
|
|
7
|
-
declare function heraldQueue(options?: HeraldQueueOptions): QueueDispatcher;
|
|
10
|
+
export declare function heraldQueue(options?: HeraldQueueOptions): QueueDispatcher;
|
|
8
11
|
//#endregion
|
|
9
|
-
export { HeraldQueueOptions, heraldQueue };
|
|
10
12
|
//# sourceMappingURL=herald-queue.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"herald-queue.d.mts","names":[],"sources":["../../../../../../../../packages/notifications/src/queue/herald-queue.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"herald-queue.d.mts","names":[],"sources":["../../../../../../../../packages/notifications/src/queue/herald-queue.ts"],"mappings":";;;YAyBY;;EAEV;;EAEA;;wBAGc,YAAY,UAAS,qBAA0B"}
|
package/esm/queue/index.d.mts
CHANGED
|
@@ -3,4 +3,5 @@ import { WorkerOptions, startNotificationsWorker } from "./notifications-worker.
|
|
|
3
3
|
import { DEFAULT_QUEUE_CHANNEL } from "./load-herald.mjs";
|
|
4
4
|
import { BullmqQueueOptions, NOTIFICATION_JOB_NAME, bullmqQueue } from "./bullmq-queue.mjs";
|
|
5
5
|
import { QueuePackageLoader, loadQueuePackage } from "./load-queue.mjs";
|
|
6
|
-
import { QueuePackageNotInstalledError } from "./queue-package-not-installed.error.mjs";
|
|
6
|
+
import { QueuePackageNotInstalledError } from "./queue-package-not-installed.error.mjs";
|
|
7
|
+
export { BullmqQueueOptions, DEFAULT_QUEUE_CHANNEL, HeraldQueueOptions, NOTIFICATION_JOB_NAME, type QueuePackageLoader, QueuePackageNotInstalledError, WorkerOptions, bullmqQueue, heraldQueue, loadQueuePackage, startNotificationsWorker };
|
package/esm/queue/index.mjs
CHANGED
|
@@ -5,4 +5,4 @@ import { QueuePackageNotInstalledError } from "./queue-package-not-installed.err
|
|
|
5
5
|
import { loadQueuePackage } from "./load-queue.mjs";
|
|
6
6
|
import { NOTIFICATION_JOB_NAME, bullmqQueue } from "./bullmq-queue.mjs";
|
|
7
7
|
|
|
8
|
-
export {
|
|
8
|
+
export { DEFAULT_QUEUE_CHANNEL, NOTIFICATION_JOB_NAME, QueuePackageNotInstalledError, bullmqQueue, heraldQueue, loadQueuePackage, startNotificationsWorker };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
//#region ../../packages/notifications/src/queue/load-herald.d.ts
|
|
2
2
|
/** The herald channel notification jobs are published to / consumed from. */
|
|
3
|
-
declare const DEFAULT_QUEUE_CHANNEL = "notifications.dispatch";
|
|
3
|
+
export declare const DEFAULT_QUEUE_CHANNEL = "notifications.dispatch";
|
|
4
4
|
//#endregion
|
|
5
|
-
export { DEFAULT_QUEUE_CHANNEL };
|
|
6
5
|
//# sourceMappingURL=load-herald.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-herald.d.mts","names":[],"sources":["../../../../../../../../packages/notifications/src/queue/load-herald.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"load-herald.d.mts","names":[],"sources":["../../../../../../../../packages/notifications/src/queue/load-herald.ts"],"mappings":";;qBAmCa"}
|
|
@@ -21,7 +21,7 @@ Or with your preferred package manager:
|
|
|
21
21
|
async function loadHerald() {
|
|
22
22
|
if (heraldModule) return heraldModule;
|
|
23
23
|
try {
|
|
24
|
-
heraldModule = await import("
|
|
24
|
+
heraldModule = await import("@warlock.js/herald");
|
|
25
25
|
return heraldModule;
|
|
26
26
|
} catch {
|
|
27
27
|
throw new Error(INSTALL_INSTRUCTIONS);
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
//#region ../../packages/notifications/src/queue/load-queue.d.ts
|
|
2
2
|
/** A function that performs the dynamic import of `@warlock.js/queue`. */
|
|
3
|
-
type QueuePackageLoader = () => Promise<typeof import("@warlock.js/queue")>;
|
|
3
|
+
export type QueuePackageLoader = () => Promise<typeof import("@warlock.js/queue")>;
|
|
4
4
|
/**
|
|
5
5
|
* Resolve `@warlock.js/queue`, memoized after the first successful load.
|
|
6
6
|
* Throws {@link QueuePackageNotInstalledError} when the import fails.
|
|
7
7
|
*/
|
|
8
|
-
declare function loadQueuePackage(loader?: QueuePackageLoader): Promise<typeof import("@warlock.js/queue")>;
|
|
8
|
+
export declare function loadQueuePackage(loader?: QueuePackageLoader): Promise<typeof import("@warlock.js/queue")>;
|
|
9
9
|
//#endregion
|
|
10
|
-
export { QueuePackageLoader, loadQueuePackage };
|
|
11
10
|
//# sourceMappingURL=load-queue.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-queue.d.mts","names":[],"sources":["../../../../../../../../packages/notifications/src/queue/load-queue.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"load-queue.d.mts","names":[],"sources":["../../../../../../../../packages/notifications/src/queue/load-queue.ts"],"mappings":";;YAaY,2BAA2B;;;;;wBAUjB,iBACpB,SAAQ,qBACP"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
//#region ../../packages/notifications/src/queue/notifications-worker.d.ts
|
|
2
|
-
type WorkerOptions = {
|
|
3
|
-
/** Herald channel to consume from. Must match the dispatcher. Default `"notifications.dispatch"`. */
|
|
2
|
+
export type WorkerOptions = {
|
|
3
|
+
/** Herald channel to consume from. Must match the dispatcher. Default `"notifications.dispatch"`. */
|
|
4
|
+
channel?: string;
|
|
5
|
+
/** Herald broker name. Default broker if omitted. */
|
|
4
6
|
broker?: string;
|
|
5
7
|
};
|
|
6
|
-
declare function startNotificationsWorker(options?: WorkerOptions): Promise<void>;
|
|
8
|
+
export declare function startNotificationsWorker(options?: WorkerOptions): Promise<void>;
|
|
7
9
|
//#endregion
|
|
8
|
-
export { WorkerOptions, startNotificationsWorker };
|
|
9
10
|
//# sourceMappingURL=notifications-worker.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifications-worker.d.mts","names":[],"sources":["../../../../../../../../packages/notifications/src/queue/notifications-worker.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"notifications-worker.d.mts","names":[],"sources":["../../../../../../../../packages/notifications/src/queue/notifications-worker.ts"],"mappings":";YAyBY;;EAEV;;EAEA;;wBAGoB,yBAAyB,UAAS,gBAAqB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifications-worker.mjs","names":[],"sources":["../../../../../../../../packages/notifications/src/queue/notifications-worker.ts"],"sourcesContent":["/**\n * Notification queue worker — consumes the jobs `heraldQueue` publishes and\n * runs the actual `channel.send`. Call this once in a worker process (or the\n * web process) after the notifications config + herald broker are up.\n *\n * The job carries an ALREADY-RENDERED payload + resolved route, so the worker\n * only looks the channel up by name and dispatches — no notifiable needed.\n *\n * @example\n * // in a worker entrypoint, after the notifications config + broker are up\n * import { startNotificationsWorker } from \"@warlock.js/notifications\";\n * await startNotificationsWorker();\n */\nimport { log } from \"@warlock.js/logger\";\nimport { getNotificationConfig } from \"../config\";\nimport type { ChannelName, SendOptions } from \"../types\";\nimport { DEFAULT_QUEUE_CHANNEL, loadHerald } from \"./load-herald\";\n\ntype NotificationJob = {\n channel: string;\n route: unknown;\n payload: unknown;\n options: SendOptions;\n};\n\nexport type WorkerOptions = {\n /** Herald channel to consume from. Must match the dispatcher. Default `\"notifications.dispatch\"`. */\n channel?: string;\n /** Herald broker name. Default broker if omitted. */\n broker?: string;\n};\n\nexport async function startNotificationsWorker(options: WorkerOptions = {}): Promise<void> {\n const channelName = options.channel ?? DEFAULT_QUEUE_CHANNEL;\n const { herald } = await loadHerald();\n\n await herald(options.broker)\n .channel(channelName)\n .subscribe(async (message: { payload: unknown }, ctx: { ack(): Promise<void> }) => {\n const job = message.payload as NotificationJob;\n\n try {\n const channel = getNotificationConfig().channels[job.channel as ChannelName];\n\n if (!channel) {\n // Unknown channel — log and ack to avoid a poison-message loop.\n log.error(\"notifications\"
|
|
1
|
+
{"version":3,"file":"notifications-worker.mjs","names":[],"sources":["../../../../../../../../packages/notifications/src/queue/notifications-worker.ts"],"sourcesContent":["/**\n * Notification queue worker — consumes the jobs `heraldQueue` publishes and\n * runs the actual `channel.send`. Call this once in a worker process (or the\n * web process) after the notifications config + herald broker are up.\n *\n * The job carries an ALREADY-RENDERED payload + resolved route, so the worker\n * only looks the channel up by name and dispatches — no notifiable needed.\n *\n * @example\n * // in a worker entrypoint, after the notifications config + broker are up\n * import { startNotificationsWorker } from \"@warlock.js/notifications\";\n * await startNotificationsWorker();\n */\nimport { log } from \"@warlock.js/logger\";\nimport { getNotificationConfig } from \"../config\";\nimport type { ChannelName, SendOptions } from \"../types\";\nimport { DEFAULT_QUEUE_CHANNEL, loadHerald } from \"./load-herald\";\n\ntype NotificationJob = {\n channel: string;\n route: unknown;\n payload: unknown;\n options: SendOptions;\n};\n\nexport type WorkerOptions = {\n /** Herald channel to consume from. Must match the dispatcher. Default `\"notifications.dispatch\"`. */\n channel?: string;\n /** Herald broker name. Default broker if omitted. */\n broker?: string;\n};\n\nexport async function startNotificationsWorker(options: WorkerOptions = {}): Promise<void> {\n const channelName = options.channel ?? DEFAULT_QUEUE_CHANNEL;\n const { herald } = await loadHerald();\n\n await herald(options.broker)\n .channel(channelName)\n .subscribe(async (message: { payload: unknown }, ctx: { ack(): Promise<void> }) => {\n const job = message.payload as NotificationJob;\n\n try {\n const channel = getNotificationConfig().channels[job.channel as ChannelName];\n\n if (!channel) {\n // Unknown channel — log and ack to avoid a poison-message loop.\n log.error(\n \"notifications\",\n \"queue.worker\",\n `Unknown channel \"${job.channel}\" — dropping job`,\n );\n await ctx.ack();\n return;\n }\n\n await channel.send({\n payload: job.payload as never,\n route: job.route as never,\n options: job.options,\n });\n\n await ctx.ack();\n } catch (error) {\n // Phase 2: log + ack (no retry/DLQ yet — that lands with the\n // delay-aware worker). A dead-letter strategy is a follow-up.\n log.error(\"notifications\", \"queue.worker\", error as Error);\n await ctx.ack();\n }\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAgCA,eAAsB,yBAAyB,UAAyB,CAAC,GAAkB;CACzF,MAAM,cAAc,QAAQ;CAC5B,MAAM,EAAE,WAAW,MAAM,WAAW;CAEpC,MAAM,OAAO,QAAQ,MAAM,CAAC,CACzB,QAAQ,WAAW,CAAC,CACpB,UAAU,OAAO,SAA+B,QAAkC;EACjF,MAAM,MAAM,QAAQ;EAEpB,IAAI;GACF,MAAM,UAAU,sBAAsB,CAAC,CAAC,SAAS,IAAI;GAErD,IAAI,CAAC,SAAS;IAEZ,IAAI,MACF,iBACA,gBACA,oBAAoB,IAAI,QAAQ,iBAClC;IACA,MAAM,IAAI,IAAI;IACd;GACF;GAEA,MAAM,QAAQ,KAAK;IACjB,SAAS,IAAI;IACb,OAAO,IAAI;IACX,SAAS,IAAI;GACf,CAAC;GAED,MAAM,IAAI,IAAI;EAChB,SAAS,OAAO;GAGd,IAAI,MAAM,iBAAiB,gBAAgB,KAAc;GACzD,MAAM,IAAI,IAAI;EAChB;CACF,CAAC;AACL"}
|
|
@@ -5,9 +5,8 @@
|
|
|
5
5
|
* time (first `.queue()` call), not at boot, matching the lazy-optional-peer
|
|
6
6
|
* pattern `loadHerald` already uses for `@warlock.js/herald`.
|
|
7
7
|
*/
|
|
8
|
-
declare class QueuePackageNotInstalledError extends Error {
|
|
8
|
+
export declare class QueuePackageNotInstalledError extends Error {
|
|
9
9
|
constructor();
|
|
10
10
|
}
|
|
11
11
|
//#endregion
|
|
12
|
-
export { QueuePackageNotInstalledError };
|
|
13
12
|
//# sourceMappingURL=queue-package-not-installed.error.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queue-package-not-installed.error.d.mts","names":[],"sources":["../../../../../../../../packages/notifications/src/queue/queue-package-not-installed.error.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"queue-package-not-installed.error.d.mts","names":[],"sources":["../../../../../../../../packages/notifications/src/queue/queue-package-not-installed.error.ts"],"mappings":";;;;;;;qBAea,sCAAsC;EACjD"}
|
package/esm/types.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Model } from "@warlock.js/cascade";
|
|
2
|
-
|
|
3
2
|
//#region ../../packages/notifications/src/types.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* A recipient you send TO (a User, etc.) — NOT the stored record.
|
|
@@ -8,30 +7,31 @@ import { Model } from "@warlock.js/cascade";
|
|
|
8
7
|
* `route` override in config), not a model concern — there is intentionally
|
|
9
8
|
* NO `routeNotificationFor` on the model.
|
|
10
9
|
*/
|
|
11
|
-
type Notifiable = Model;
|
|
10
|
+
export type Notifiable = Model;
|
|
12
11
|
/** An identifier — string (uuid / objectId) or number (auto-increment). */
|
|
13
|
-
type Id = string | number;
|
|
12
|
+
export type Id = string | number;
|
|
14
13
|
/** What the `mail` channel renders to and `core.sendMail` consumes. */
|
|
15
|
-
type MailPayload = {
|
|
14
|
+
export type MailPayload = {
|
|
16
15
|
subject: string;
|
|
17
16
|
html?: string;
|
|
18
17
|
text?: string;
|
|
19
18
|
cc?: string | string[];
|
|
20
19
|
};
|
|
21
20
|
/** Normalized in-app record shape written through the database channel. */
|
|
22
|
-
type NotificationInput = {
|
|
21
|
+
export type NotificationInput = {
|
|
23
22
|
recipientId: Id;
|
|
24
23
|
type: string;
|
|
25
24
|
title: string;
|
|
26
25
|
body?: string;
|
|
27
|
-
payload?: Record<string, unknown>;
|
|
26
|
+
payload?: Record<string, unknown>;
|
|
27
|
+
/** Unique-per-recipient dedupe key — see `SendOptions.idempotencyKey`. */
|
|
28
28
|
idempotencyKey?: string;
|
|
29
29
|
};
|
|
30
30
|
/**
|
|
31
31
|
* Database payload as seen by RENDERERS — `recipientId` is set by the channel
|
|
32
32
|
* from the resolved route, not by the render closure.
|
|
33
33
|
*/
|
|
34
|
-
type DatabasePayload = Omit<NotificationInput, "recipientId">;
|
|
34
|
+
export type DatabasePayload = Omit<NotificationInput, "recipientId">;
|
|
35
35
|
/**
|
|
36
36
|
* Channel REGISTRY — the single declaration-merge target mapping channel NAME
|
|
37
37
|
* → payload type. Drives `notify.<channel>` proxy typing and
|
|
@@ -45,11 +45,11 @@ type DatabasePayload = Omit<NotificationInput, "recipientId">;
|
|
|
45
45
|
* (`whatsapp`, `telegram`, `push`, `slack`) ship in Phase 2 as the same
|
|
46
46
|
* declaration-merge pattern.
|
|
47
47
|
*/
|
|
48
|
-
interface NotificationChannels {
|
|
48
|
+
export interface NotificationChannels {
|
|
49
49
|
mail: MailPayload;
|
|
50
50
|
database: DatabasePayload;
|
|
51
51
|
}
|
|
52
|
-
type ChannelName = keyof NotificationChannels;
|
|
52
|
+
export type ChannelName = keyof NotificationChannels;
|
|
53
53
|
/**
|
|
54
54
|
* Per-send options — the optional 3rd arg of `notify.<channel>` / `send` /
|
|
55
55
|
* `queue`. Lean by design: `queue` and `only` are METHODS on a defined
|
|
@@ -62,7 +62,7 @@ type ChannelName = keyof NotificationChannels;
|
|
|
62
62
|
* - `type` opts ad-hoc `notify.<channel>` sends into preference/rate-limit
|
|
63
63
|
* gating. `defineNotification` reads its own `def.type` and ignores this.
|
|
64
64
|
*/
|
|
65
|
-
type SendOptions = {
|
|
65
|
+
export type SendOptions = {
|
|
66
66
|
/**
|
|
67
67
|
* Delay the dispatch, e.g. `"10m"` / `"3d"` / `600` (seconds). RESERVED —
|
|
68
68
|
* NOT honored yet: `.send()` always dispatches immediately, and the current
|
|
@@ -70,15 +70,20 @@ type SendOptions = {
|
|
|
70
70
|
* lands with the delay-aware worker (Phase 2); until then this field is a
|
|
71
71
|
* no-op on both paths.
|
|
72
72
|
*/
|
|
73
|
-
delay?: number | string;
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
73
|
+
delay?: number | string;
|
|
74
|
+
/** Locale for rendering — passed to renderers via `RenderContext`. */
|
|
75
|
+
locale?: string;
|
|
76
|
+
/** Passthrough to channels + every observability event (via `options`). */
|
|
77
|
+
meta?: Record<string, unknown>;
|
|
78
|
+
/** Dedupe key for retry-safe sends. */
|
|
79
|
+
idempotencyKey?: string;
|
|
80
|
+
/** Bypass `PreferenceProvider`. Does NOT bypass `RateLimiter`. */
|
|
81
|
+
force?: boolean;
|
|
82
|
+
/** Notification type for ad-hoc gating (unused by `defineNotification`). */
|
|
78
83
|
type?: string;
|
|
79
84
|
};
|
|
80
85
|
/** What a renderer receives as its 3rd arg — i18n + meta passthrough only. */
|
|
81
|
-
type RenderContext = Pick<SendOptions, "locale" | "meta">;
|
|
86
|
+
export type RenderContext = Pick<SendOptions, "locale" | "meta">;
|
|
82
87
|
/**
|
|
83
88
|
* Event surface for metrics, logging, audits. Fires per (channel, recipient)
|
|
84
89
|
* — fan-out emits N events.
|
|
@@ -92,7 +97,7 @@ type RenderContext = Pick<SendOptions, "locale" | "meta">;
|
|
|
92
97
|
* send; on a queued send it is the enqueue time (real delivery timing is
|
|
93
98
|
* worker-side).
|
|
94
99
|
*/
|
|
95
|
-
type NotificationEvents = {
|
|
100
|
+
export type NotificationEvents = {
|
|
96
101
|
sending: {
|
|
97
102
|
dispatchId: string;
|
|
98
103
|
channel: string;
|
|
@@ -126,5 +131,4 @@ type NotificationEvents = {
|
|
|
126
131
|
};
|
|
127
132
|
};
|
|
128
133
|
//#endregion
|
|
129
|
-
export { ChannelName, DatabasePayload, Id, MailPayload, Notifiable, NotificationChannels, NotificationEvents, NotificationInput, RenderContext, SendOptions };
|
|
130
134
|
//# sourceMappingURL=types.d.mts.map
|
package/esm/types.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.mts","names":[],"sources":["../../../../../../../packages/notifications/src/types.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.mts","names":[],"sources":["../../../../../../../packages/notifications/src/types.ts"],"mappings":";;;;;;;;;YAkBY,aAAa;;YAGb;;YAKA;EACV;EACA;EACA;EACA;;;YAIU;EACV,aAAa;EACb;EACA;EACA;EACA,UAAU;;EAEV;;;;;;YAOU,kBAAkB,KAAK;;;;;;;;;;;;;;iBAiBlB;EACf,MAAM;EACN,UAAU;;YAGA,oBAAoB;;;;;;;;;;;;;YAgBpB;;;;;;;;EAQV;;EAEA;;EAEA,OAAO;;EAEP;;EAEA;;EAEA;;;YAIU,gBAAgB,KAAK;;;;;;;;;;;;;;YAiBrB;EACV;IACE;IACA;IACA,aAAa;IACb;IACA,SAAS;;EAEX;IACE;IACA;IACA,aAAa;IACb;IACA,SAAS;IACT;;EAEF;IACE;IACA;IACA,aAAa;IACb;IACA,OAAO;IACP,SAAS;IACT;;EAEF;IACE;IACA;IACA,aAAa;IACb;IACA,SAAS"}
|