Add assert decorator

Repository details (botten-nappet)
Project page
botten-nappet
Project log category
(195 entries)
Owner
@joelpurra
Contributors
Contributors on Github
Project status
💤 This project is inactive.
📂 This project is open.
🤷 This project is not particularly popular.
Repository activity period
🗓
Commits
209 commits
Stars
5 stars
Commit details (040b45c6)
Author
Authored at
Committer
Joel Purra
Committed at

Commit message

Add assert decorator

  • For class constructors and methods
    • Replace argument count assertions with @asrt(n).
    • Replace argument/auto-property assigned (usually non-null) assertions with @asrt().
  • Kept state-checking assertions (is initialized/connected/running/started).
  • Removed parameter shape (string length, string prefixes, object properties) assertions.
Raw text
Add assert decorator

- For class constructors and methods
  - Replace argument count assertions with `@asrt(n)`.
  - Replace argument/auto-property assigned (usually non-null) assertions with `@asrt()`.
- Kept state-checking assertions (is initialized/connected/running/started).
- Removed parameter shape (string length, string prefixes, object properties) assertions.

Changed files (119)

Path Additions Deletions
package/backend-shared/src/config/backend-config.ts +6 -4
package/backend-shared/src/config/database-config.ts +6 -8
package/backend-shared/src/distributed-events/distributed-event-manager.ts +14 -18
package/backend-shared/src/storage/database-connection.ts +8 -12
package/backend-shared/src/storage/manager/distributed-event-storage-manager.ts +13 -15
package/backend-shared/src/storage/manager/user-storage-manager.ts +20 -11
package/backend-shared/src/storage/repository/distributed-event-repository.ts +3 -4
package/backend-shared/src/storage/repository/embedded-documents/augmented-token-embedded-document.ts +3 -4
package/backend-shared/src/storage/repository/embedded-documents/raw-token-embedded-document.ts +3 -4
package/backend-shared/src/storage/repository/user-repository.ts +3 -4
package/backend-twitch/src/authentication/application-access-token-provider.ts +7 -10
package/backend-twitch/src/authentication/application-token-manager.ts +33 -44
package/backend-twitch/src/authentication/polling-application-token-connection.ts +9 -27
package/backend-twitch/src/authentication/user-access-token-provider.ts +7 -10
package/backend-twitch/src/authentication/user-augmented-token-provider.ts +8 -12
package/backend-twitch/src/authentication/user-channel-provider.ts +7 -10
package/backend-twitch/src/authentication/user-id-provider.ts +8 -12
package/backend-twitch/src/authentication/user-name-provider.ts +7 -10
package/backend-twitch/src/authentication/user-raw-token-provider.ts +7 -10
package/backend-twitch/src/authentication/user-token-manager.ts +13 -12
package/backend-twitch/src/config/application-token-manager-config.ts +6 -8
package/backend-twitch/src/config/irc-config.ts +6 -8
package/backend-twitch/src/config/polling-application-token-connection-config.ts +6 -8
package/backend-twitch/src/config/pubsub-config.ts +6 -8
package/backend-twitch/src/config/token-helper-config.ts +6 -8
package/backend-twitch/src/config/user-authentication-config.ts +6 -8
package/backend-twitch/src/handler/cheering-irc-reply-handler.ts +14 -18
package/backend-twitch/src/handler/cheering-with-cheermotes-handler.ts +27 -24
package/backend-twitch/src/handler/follow-reminder.ts +20 -26
package/backend-twitch/src/handler/{following-Irc-reply-handler.ts => following-irc-reply-handler.ts} +14 -18
package/backend-twitch/src/handler/greeting.ts +15 -19
package/backend-twitch/src/handler/new-chatter.ts +14 -18
package/backend-twitch/src/handler/streaming-statistics-collector-handler.ts +14 -18
package/backend-twitch/src/handler/subscribing.ts +14 -18
package/backend-twitch/src/handler/subscription-irc-reply-handler.ts +14 -18
package/backend-twitch/src/handler/text-response-command.ts +14 -18
package/backend-twitch/src/handler/vidy-command.ts +14 -18
package/backend-twitch/src/handler/vidy-result-event.ts +17 -17
package/backend-twitch/src/handler/whisper-irc-reply-handler.ts +16 -16
package/backend-twitch/src/helper/token-helper.ts +31 -44
package/backend-twitch/src/helper/user-helper.ts +11 -17
package/backend-twitch/src/helper/user-token-helper.ts +45 -51
package/backend-twitch/src/irc/connection/irc-connection.ts +18 -14
package/backend-twitch/src/irc/connection/irc-manager.ts +5 -8
package/backend-twitch/src/irc/handler/logging.ts +13 -16
package/backend-twitch/src/irc/handler/ping.ts +13 -16
package/backend-twitch/src/irc/handler/reconnect.ts +15 -15
package/backend-twitch/src/irc/translator/incoming-irc-command-event-translator.ts +14 -18
package/backend-twitch/src/irc/translator/outgoing-irc-command-event-handler.ts +14 -18
package/backend-twitch/src/polling/connection/polling-clientid-connection.ts +15 -11
package/backend-twitch/src/polling/connection/polling-connection.ts +24 -19
package/backend-twitch/src/polling/connection/polling-manager.ts +7 -7
package/backend-twitch/src/polling/translator/incoming-polling-event-translator.ts +17 -17
package/backend-twitch/src/pubsub/connection/pubsub-connection.ts +14 -11
package/backend-twitch/src/pubsub/connection/pubsub-manager.ts +7 -7
package/backend-twitch/src/pubsub/connection/user-pubsub-topics-provider.ts +7 -12
package/backend-twitch/src/pubsub/handler/logging.ts +15 -15
package/backend-twitch/src/pubsub/handler/ping.ts +19 -17
package/backend-twitch/src/pubsub/handler/reconnect.ts +15 -15
package/backend-twitch/src/pubsub/translator/incoming-pubsub-event-translator.ts +14 -18
package/backend-twitch/src/translator/incoming-cheering-event-translator.ts +14 -18
package/backend-twitch/src/translator/incoming-cheermotes-event-translator.ts +17 -23
package/backend-twitch/src/translator/incoming-following-event-translator.ts +17 -23
package/backend-twitch/src/translator/incoming-streaming-event-translator.ts +17 -20
package/backend-twitch/src/translator/incoming-subscription-event-translator.ts +16 -23
package/backend-twitch/src/translator/incoming-whisper-event-translator.ts +14 -18
package/backend-twitch/src/websocket/connection/websocket-connection.ts +18 -13
package/backend-vidy/src/request/authenticated-request.ts +34 -17
package/backend-vidy/src/translator/outgoing-search-command-handler.ts +17 -18
package/server-backend/src/distributed-events/external-distributed-event-manager.ts +7 -11
package/server-backend/src/main/authenticated-application-main.ts +18 -28
package/server-backend/src/main/main.ts +8 -13
package/server-backend/src/main/managed-main.ts +10 -18
package/server-backend/src/main/manager-main.ts +10 -18
package/server-backend/src/main/per-user-handlers-main.ts +32 -50
package/server-backend/src/message-queue/external-raw-topic.ts +4 -0
package/server-backend/src/message-queue/external-raw-topics-subscriber.ts +8 -13
package/server-backend/src/topics-macro/single-item-topics-subscriber.ts.m4 +8 -13
package/server-backend/src/topics-macro/topic-publisher.ts.m4 +7 -11
package/server-backend/src/topics-macro/topic.ts.m4 +5 -1
package/server-frontend/src/config/frontend-config.ts +6 -4
package/server-frontend/src/main/main.ts +8 -13
package/server-frontend/src/main/managed-main.ts +8 -13
package/server-frontend/src/main/manager-main.ts +18 -24
package/server-shared/src/main.ts +4 -1
package/server-shared/src/shared-container-root.ts +10 -17
package/server-twitch/src/irc-authenticated-application-api.ts +11 -18
package/server-twitch/src/per-user-irc-api.ts +13 -21
package/server-twitch/src/per-user-polling-api.ts +13 -19
package/server-twitch/src/per-user-pubsub-api.ts +12 -17
package/server-twitch/src/polling-authenticated-application-api.ts +11 -15
package/server-twitch/src/polling-connection/cheermotes-response-polling-clientid-connection.ts +8 -13
package/server-twitch/src/polling-connection/following-response-polling-clientid-connection.ts +8 -13
package/server-twitch/src/polling-connection/streaming-response-polling-clientid-connection.ts +8 -13
package/server-twitch/src/pubsub-authenticated-application-api.ts +9 -11
package/server-vidy/src/api.ts +12 -17
package/server-vidy/src/application-api.ts +9 -11
package/shared/src/config/logging-config.ts +6 -8
package/shared/src/config/shared-config.ts +7 -6
package/shared/src/config/shared-topics-config.ts +6 -8
package/shared/src/config/topic-config.ts +5 -2
package/shared/src/config/zmq-config.ts +6 -8
package/shared/src/connection/connection-manager.ts +8 -8
package/shared/src/connection/multi-connection-manager.ts +8 -6
package/shared/src/event/event-subscription-manager.ts +7 -7
package/shared/src/event/multi-event-subscription-manager.ts +7 -3
package/shared/src/message-queue/intersection-topics-subscriber.ts +11 -19
package/shared/src/message-queue/item-array-json-topics-subscriber.ts +11 -17
package/shared/src/message-queue/json-topics-subscriber.ts +11 -17
package/shared/src/message-queue/publisher.ts +14 -11
package/shared/src/message-queue/raw-topics-subscriber.ts +11 -19
package/shared/src/message-queue/single-item-topics-subscriber.ts +11 -18
package/shared/src/message-queue/topic-publisher.ts +13 -19
package/shared/src/message-queue/topics-splitter.ts +8 -4
package/shared/src/message-queue/topics-subscriber.ts +12 -15
package/shared/src/util/asrt.ts +150 -0
package/shared/src/util/graceful-shutdown-manager.ts +33 -16
package/shared/src/util/pino-logger.ts +5 -1
package/shared/src/util/root-logger-resolver.ts +8 -3

Commit categories (3)