@nlabs/reaktor 0.10.1 → 0.10.5
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/coverage/actions/index.html +21 -36
- package/coverage/actions/notifications.ts.html +223 -0
- package/coverage/actions/posts.ts.html +2356 -0
- package/coverage/adapters/arangoAdapter.ts.html +170 -20
- package/coverage/adapters/fileAdapter.ts.html +445 -0
- package/coverage/adapters/index.html +72 -42
- package/coverage/adapters/postAdapter.ts.html +436 -0
- package/coverage/adapters/reaktorAdapter.ts.html +201 -18
- package/coverage/adapters/tagAdapter.ts.html +274 -25
- package/coverage/adapters/userAdapter.ts.html +829 -0
- package/coverage/analyticsUtils.ts.html +286 -0
- package/coverage/block-navigation.js +1 -1
- package/coverage/config.ts.html +766 -0
- package/coverage/index.html +83 -53
- package/coverage/mocks/group.ts.html +5 -5
- package/coverage/mocks/image.ts.html +18 -12
- package/coverage/mocks/index.html +37 -7
- package/coverage/mocks/post.ts.html +8 -8
- package/coverage/mocks/tag.ts.html +2 -2
- package/coverage/mocks/user.ts.html +18 -15
- package/coverage/sorter.js +21 -7
- package/coverage/testUtils.ts.html +1309 -0
- package/coverage/translationQueue.ts.html +592 -0
- package/coverage/types/error.types.ts.html +148 -0
- package/coverage/types/index.html +2 -2
- package/coverage/utils/adapterUtils.ts.html +39 -27
- package/coverage/utils/analyticsUtils.ts.html +35 -41
- package/coverage/utils/authUtils.ts.html +328 -0
- package/coverage/utils/dbI18n.ts.html +280 -0
- package/coverage/utils/googleTranslate.ts.html +385 -0
- package/coverage/utils/index.html +29 -44
- package/coverage/utils/localeUtils.ts.html +193 -0
- package/coverage/utils/sessionUtils.ts.html +211 -0
- package/coverage/utils/testUtils.ts.html +1309 -0
- package/lex.config.mjs +34 -0
- package/lib/actions/apps.d.ts +25 -0
- package/lib/actions/connections.d.ts +5 -0
- package/lib/actions/content.d.ts +13 -0
- package/lib/actions/conversations.d.ts +16 -0
- package/lib/actions/dynamodb.d.ts +12 -0
- package/lib/actions/email.d.ts +8 -0
- package/lib/actions/files.d.ts +19 -0
- package/lib/actions/groups.d.ts +13 -0
- package/lib/actions/images.d.ts +33 -0
- package/lib/actions/index.d.ts +28 -0
- package/lib/actions/ios.d.ts +7 -0
- package/lib/actions/locations.d.ts +6 -0
- package/lib/actions/messages.d.ts +13 -0
- package/lib/actions/notifications.d.ts +9 -0
- package/lib/actions/payments.d.ts +12 -0
- package/lib/actions/posts.d.ts +25 -0
- package/lib/actions/profiles.d.ts +4 -0
- package/lib/actions/reactions.d.ts +32 -0
- package/lib/actions/s3.d.ts +11 -0
- package/lib/actions/search.d.ts +3 -0
- package/lib/actions/sms.d.ts +2 -0
- package/lib/actions/statistics.d.ts +4 -0
- package/lib/actions/subscriptions.d.ts +7 -0
- package/lib/actions/tags.d.ts +34 -0
- package/lib/actions/users.d.ts +73 -0
- package/lib/actions/videos.d.ts +25 -0
- package/lib/actions/websockets.d.ts +20 -0
- package/lib/adapters/arangoAdapter.d.ts +8 -0
- package/lib/adapters/contentAdapter.d.ts +8 -0
- package/lib/adapters/fileAdapter.d.ts +9 -0
- package/lib/adapters/imageAdapter.d.ts +8 -0
- package/lib/adapters/index.d.ts +9 -0
- package/lib/adapters/messageAdapter.d.ts +8 -0
- package/lib/adapters/postAdapter.d.ts +8 -0
- package/lib/adapters/reaktorAdapter.d.ts +16 -0
- package/lib/adapters/tagAdapter.d.ts +9 -0
- package/lib/adapters/userAdapter.d.ts +13 -0
- package/lib/config.d.ts +57 -0
- package/lib/handlers/graphqlHandler.d.ts +4 -0
- package/lib/index.d.ts +19 -0
- package/lib/lambdas/actions/websockets.d.ts +7 -0
- package/lib/lambdas/authorizer.d.ts +20 -0
- package/lib/lambdas/connection.d.ts +12 -0
- package/lib/lambdas/utils/message.d.ts +1 -0
- package/lib/lambdas/utils/websocket.d.ts +7 -0
- package/lib/mocks/conversation.d.ts +8 -0
- package/lib/mocks/file.d.ts +11 -0
- package/lib/mocks/group.d.ts +17 -0
- package/lib/mocks/image.d.ts +3 -0
- package/lib/mocks/post.d.ts +38 -0
- package/lib/mocks/tag.d.ts +2 -0
- package/lib/mocks/user.d.ts +4 -0
- package/lib/mocks/video.d.ts +3 -0
- package/lib/mutations/content.d.ts +2 -0
- package/lib/mutations/index.d.ts +11 -0
- package/lib/mutations/locations.d.ts +2 -0
- package/lib/mutations/messages.d.ts +2 -0
- package/lib/mutations/posts.d.ts +2 -0
- package/lib/mutations/profiles.d.ts +2 -0
- package/lib/mutations/reactions.d.ts +2 -0
- package/lib/mutations/statistics.d.ts +2 -0
- package/lib/mutations/subscriptions.d.ts +2 -0
- package/lib/mutations/tags.d.ts +2 -0
- package/lib/mutations/users.d.ts +1 -0
- package/lib/objectTypes/app.d.ts +3 -0
- package/lib/objectTypes/bankAccount.d.ts +1 -0
- package/lib/objectTypes/connection.d.ts +1 -0
- package/lib/objectTypes/content.d.ts +2 -0
- package/lib/objectTypes/conversation.d.ts +2 -0
- package/lib/objectTypes/creditCard.d.ts +1 -0
- package/lib/objectTypes/document.d.ts +1 -0
- package/lib/objectTypes/error.d.ts +1 -0
- package/lib/objectTypes/external.d.ts +1 -0
- package/lib/objectTypes/file.d.ts +2 -0
- package/lib/objectTypes/filter.d.ts +1 -0
- package/lib/objectTypes/group.d.ts +3 -0
- package/lib/objectTypes/iapSubscription.d.ts +1 -0
- package/lib/objectTypes/image.d.ts +6 -0
- package/lib/objectTypes/index.d.ts +26 -0
- package/lib/objectTypes/location.d.ts +2 -0
- package/lib/objectTypes/message.d.ts +2 -0
- package/lib/objectTypes/passcode.d.ts +1 -0
- package/lib/objectTypes/plan.d.ts +2 -0
- package/lib/objectTypes/post.d.ts +2 -0
- package/lib/objectTypes/profile.d.ts +3 -0
- package/lib/objectTypes/reaction.d.ts +2 -0
- package/lib/objectTypes/relation.d.ts +1 -0
- package/lib/objectTypes/search.d.ts +1 -0
- package/lib/objectTypes/statistics.d.ts +1 -0
- package/lib/objectTypes/subscription.d.ts +2 -0
- package/lib/objectTypes/tag.d.ts +2 -0
- package/lib/objectTypes/user.d.ts +4 -0
- package/lib/queries/content.d.ts +2 -0
- package/lib/queries/index.d.ts +10 -0
- package/lib/queries/locations.d.ts +2 -0
- package/lib/queries/messages.d.ts +2 -0
- package/lib/queries/posts.d.ts +2 -0
- package/lib/queries/reactions.d.ts +2 -0
- package/lib/queries/statistics.d.ts +2 -0
- package/lib/queries/subscriptions.d.ts +2 -0
- package/lib/queries/tags.d.ts +2 -0
- package/lib/queries/users.d.ts +1 -0
- package/lib/templates/email/layout.d.ts +2 -0
- package/lib/templates/email/passwordForgot.d.ts +2 -0
- package/lib/templates/email/passwordRecovery.d.ts +2 -0
- package/lib/templates/email/verifyEmail.d.ts +2 -0
- package/lib/templates/email/welcome.d.ts +2 -0
- package/lib/templates/sms/passwordForgot.d.ts +2 -0
- package/lib/templates/sms/passwordRecovery.d.ts +2 -0
- package/lib/templates/sms/verifyEmail.d.ts +2 -0
- package/lib/templates/sms/verifyPhone.d.ts +2 -0
- package/lib/templates/sms/welcome.d.ts +2 -0
- package/lib/types/apps.types.d.ts +50 -0
- package/lib/types/arangodb.types.d.ts +38 -0
- package/lib/types/auth.types.d.ts +15 -0
- package/lib/types/connections.types.d.ts +9 -0
- package/lib/types/content.types.d.ts +31 -0
- package/lib/types/conversations.types.d.ts +31 -0
- package/lib/types/email.types.d.ts +17 -0
- package/lib/types/error.types.d.ts +21 -0
- package/lib/types/files.types.d.ts +27 -0
- package/lib/types/google.types.d.ts +33 -0
- package/lib/types/groups.types.d.ts +22 -0
- package/lib/types/images.types.d.ts +56 -0
- package/lib/types/index.d.ts +27 -0
- package/lib/types/locations.types.d.ts +22 -0
- package/lib/types/messages.types.d.ts +20 -0
- package/lib/types/notifications.types.d.ts +23 -0
- package/lib/types/payments.types.d.ts +113 -0
- package/lib/types/posts.types.d.ts +32 -0
- package/lib/types/profiles.types.d.ts +20 -0
- package/lib/types/statistics.types.d.ts +3 -0
- package/lib/types/tags.types.d.ts +19 -0
- package/lib/types/users.types.d.ts +110 -0
- package/lib/types/videos.types.d.ts +46 -0
- package/lib/types/websockets.types.d.ts +22 -0
- package/lib/utils/adapterUtils.d.ts +5 -0
- package/lib/utils/analyticsUtils.d.ts +25 -0
- package/lib/utils/arangodbUtils.d.ts +70 -0
- package/lib/utils/authUtils.d.ts +23 -0
- package/lib/utils/contextUtils.d.ts +3 -0
- package/lib/utils/dbI18n.d.ts +10 -0
- package/lib/utils/dbI18n.example.d.ts +20 -0
- package/lib/utils/googleTranslate.d.ts +6 -0
- package/lib/utils/graphqlUtils.d.ts +10 -0
- package/lib/utils/index.d.ts +18 -0
- package/lib/utils/languageDetection.d.ts +8 -0
- package/lib/utils/localeUtils.d.ts +11 -0
- package/lib/utils/localeUtils.example.d.ts +5 -0
- package/lib/utils/middlewareUtils.d.ts +2 -0
- package/lib/utils/sessionUtils.d.ts +18 -0
- package/lib/utils/stripeUtils.d.ts +7 -0
- package/lib/utils/templateUtils.d.ts +3 -0
- package/lib/utils/testUtils.d.ts +95 -0
- package/lib/utils/translationQueue.d.ts +29 -0
- package/lib/utils/translationQueue.example.d.ts +33 -0
- package/package.json +28 -28
- package/tsconfig.build.json +21 -0
- package/tsconfig.lint.json +33 -0
- package/tsconfig.test.json +31 -0
- package/dist/actions/apps.js +0 -242
- package/dist/actions/connections.js +0 -90
- package/dist/actions/conversations.js +0 -350
- package/dist/actions/dynamodb.js +0 -150
- package/dist/actions/email.js +0 -152
- package/dist/actions/files.js +0 -283
- package/dist/actions/groups.js +0 -292
- package/dist/actions/images.js +0 -735
- package/dist/actions/index.js +0 -66
- package/dist/actions/ios.js +0 -164
- package/dist/actions/locations.js +0 -122
- package/dist/actions/messages.js +0 -208
- package/dist/actions/notifications.js +0 -59
- package/dist/actions/payments.js +0 -497
- package/dist/actions/personas.js +0 -110
- package/dist/actions/posts.js +0 -595
- package/dist/actions/reactions.js +0 -322
- package/dist/actions/s3.js +0 -133
- package/dist/actions/search.js +0 -90
- package/dist/actions/sms.js +0 -108
- package/dist/actions/statistics.js +0 -62
- package/dist/actions/subscription.js +0 -220
- package/dist/actions/tags.js +0 -292
- package/dist/actions/users.js +0 -784
- package/dist/actions/websockets.js +0 -174
- package/dist/adapters/arangoAdapter.js +0 -46
- package/dist/adapters/fileAdapter.js +0 -76
- package/dist/adapters/imageAdapter.js +0 -40
- package/dist/adapters/messageAdapter.js +0 -49
- package/dist/adapters/postAdapter.js +0 -70
- package/dist/adapters/reaktorAdapter.js +0 -44
- package/dist/adapters/tagAdapter.js +0 -50
- package/dist/adapters/userAdapter.js +0 -115
- package/dist/config.js +0 -125
- package/dist/index.js +0 -66
- package/dist/lambdas/actions/websockets.js +0 -132
- package/dist/lambdas/authorizer.js +0 -67
- package/dist/lambdas/connection.js +0 -91
- package/dist/lambdas/utils/message.js +0 -42
- package/dist/lambdas/utils/websocket.js +0 -105
- package/dist/mocks/conversation.js +0 -35
- package/dist/mocks/file.js +0 -38
- package/dist/mocks/group.js +0 -47
- package/dist/mocks/image.js +0 -44
- package/dist/mocks/nlabs.png +0 -0
- package/dist/mocks/post.js +0 -55
- package/dist/mocks/tag.js +0 -37
- package/dist/mocks/user.js +0 -88
- package/dist/mutations/index.js +0 -26
- package/dist/mutations/locations.js +0 -44
- package/dist/mutations/messages.js +0 -86
- package/dist/mutations/personas.js +0 -100
- package/dist/mutations/posts.js +0 -53
- package/dist/mutations/reactions.js +0 -51
- package/dist/mutations/statistics.js +0 -39
- package/dist/mutations/subscriptions.js +0 -56
- package/dist/mutations/tags.js +0 -120
- package/dist/mutations/users.js +0 -116
- package/dist/objectTypes/app.js +0 -173
- package/dist/objectTypes/bankAccount.js +0 -76
- package/dist/objectTypes/connection.js +0 -48
- package/dist/objectTypes/conversation.js +0 -77
- package/dist/objectTypes/creditCard.js +0 -86
- package/dist/objectTypes/document.js +0 -46
- package/dist/objectTypes/error.js +0 -46
- package/dist/objectTypes/external.js +0 -74
- package/dist/objectTypes/file.js +0 -100
- package/dist/objectTypes/filter.js +0 -43
- package/dist/objectTypes/group.js +0 -123
- package/dist/objectTypes/iapSubscription.js +0 -40
- package/dist/objectTypes/image.js +0 -129
- package/dist/objectTypes/index.js +0 -68
- package/dist/objectTypes/location.js +0 -109
- package/dist/objectTypes/message.js +0 -96
- package/dist/objectTypes/passcode.js +0 -42
- package/dist/objectTypes/persona.js +0 -87
- package/dist/objectTypes/plan.js +0 -95
- package/dist/objectTypes/post.js +0 -125
- package/dist/objectTypes/reaction.js +0 -61
- package/dist/objectTypes/relation.js +0 -49
- package/dist/objectTypes/search.js +0 -72
- package/dist/objectTypes/statistics.js +0 -39
- package/dist/objectTypes/subscription.js +0 -117
- package/dist/objectTypes/tag.js +0 -65
- package/dist/objectTypes/user.js +0 -144
- package/dist/queries/index.js +0 -33
- package/dist/queries/locations.js +0 -45
- package/dist/queries/messages.js +0 -52
- package/dist/queries/posts.js +0 -154
- package/dist/queries/reactions.js +0 -56
- package/dist/queries/statistics.js +0 -39
- package/dist/queries/subscriptions.js +0 -44
- package/dist/queries/tags.js +0 -75
- package/dist/queries/users.js +0 -64
- package/dist/templates/email/layout.js +0 -302
- package/dist/templates/email/passwordForgot.js +0 -38
- package/dist/templates/email/passwordRecovery.js +0 -35
- package/dist/templates/email/verifyEmail.js +0 -38
- package/dist/templates/email/welcome.js +0 -38
- package/dist/templates/sms/passwordForgot.js +0 -24
- package/dist/templates/sms/passwordRecovery.js +0 -24
- package/dist/templates/sms/verifyEmail.js +0 -24
- package/dist/templates/sms/verifyPhone.js +0 -24
- package/dist/templates/sms/welcome.js +0 -24
- package/dist/types/apps.js +0 -32
- package/dist/types/arangodb.js +0 -16
- package/dist/types/auth.js +0 -16
- package/dist/types/connections.js +0 -16
- package/dist/types/conversations.js +0 -16
- package/dist/types/email.js +0 -16
- package/dist/types/error.js +0 -44
- package/dist/types/files.js +0 -16
- package/dist/types/google.js +0 -16
- package/dist/types/groups.js +0 -16
- package/dist/types/images.js +0 -16
- package/dist/types/index.js +0 -60
- package/dist/types/locations.js +0 -16
- package/dist/types/messages.js +0 -16
- package/dist/types/notifications.js +0 -16
- package/dist/types/payments.js +0 -16
- package/dist/types/personas.js +0 -16
- package/dist/types/posts.js +0 -16
- package/dist/types/statistics.js +0 -16
- package/dist/types/tags.js +0 -16
- package/dist/types/users.js +0 -16
- package/dist/types/websockets.js +0 -16
- package/dist/utils/adapterUtils.js +0 -45
- package/dist/utils/analyticsUtils.js +0 -72
- package/dist/utils/arangodbUtils.js +0 -165
- package/dist/utils/auth.js +0 -57
- package/dist/utils/index.js +0 -30
- package/dist/utils/session.js +0 -60
- package/jest.config.js +0 -17
- package/jest.setup.js +0 -36
- package/lex.config.cjs +0 -13
- package/lib/actions/apps.js +0 -20
- package/lib/actions/connections.js +0 -7
- package/lib/actions/content.js +0 -17
- package/lib/actions/conversations.js +0 -33
- package/lib/actions/dynamodb.js +0 -2
- package/lib/actions/email.js +0 -2
- package/lib/actions/files.js +0 -5
- package/lib/actions/groups.js +0 -52
- package/lib/actions/images.js +0 -66
- package/lib/actions/index.js +0 -2
- package/lib/actions/ios.js +0 -11
- package/lib/actions/locations.js +0 -7
- package/lib/actions/messages.js +0 -33
- package/lib/actions/notifications.js +0 -2
- package/lib/actions/payments.js +0 -32
- package/lib/actions/posts.js +0 -143
- package/lib/actions/profiles.js +0 -8
- package/lib/actions/reactions.js +0 -35
- package/lib/actions/s3.js +0 -2
- package/lib/actions/search.js +0 -5
- package/lib/actions/sms.js +0 -2
- package/lib/actions/statistics.js +0 -8
- package/lib/actions/subscriptions.js +0 -12
- package/lib/actions/tags.js +0 -24
- package/lib/actions/users.js +0 -84
- package/lib/actions/websockets.js +0 -30
- package/lib/adapters/arangoAdapter.js +0 -2
- package/lib/adapters/contentAdapter.js +0 -2
- package/lib/adapters/fileAdapter.js +0 -2
- package/lib/adapters/imageAdapter.js +0 -2
- package/lib/adapters/messageAdapter.js +0 -2
- package/lib/adapters/postAdapter.js +0 -2
- package/lib/adapters/reaktorAdapter.js +0 -2
- package/lib/adapters/tagAdapter.js +0 -2
- package/lib/adapters/userAdapter.js +0 -2
- package/lib/config.js +0 -2
- package/lib/handlers/graphqlHandler.js +0 -2
- package/lib/index.js +0 -2
- package/lib/lambdas/actions/websockets.js +0 -30
- package/lib/lambdas/authorizer.js +0 -2
- package/lib/lambdas/connection.js +0 -2
- package/lib/lambdas/utils/message.js +0 -2
- package/lib/lambdas/utils/websocket.js +0 -2
- package/lib/mocks/conversation.js +0 -2
- package/lib/mocks/file.js +0 -2
- package/lib/mocks/group.js +0 -2
- package/lib/mocks/image.js +0 -2
- package/lib/mocks/post.js +0 -2
- package/lib/mocks/tag.js +0 -2
- package/lib/mocks/user.js +0 -2
- package/lib/mutations/index.js +0 -2
- package/lib/mutations/locations.integration.js +0 -2
- package/lib/mutations/locations.js +0 -2
- package/lib/mutations/messages.integration.js +0 -2
- package/lib/mutations/messages.js +0 -2
- package/lib/mutations/posts.integration.js +0 -2
- package/lib/mutations/posts.js +0 -2
- package/lib/mutations/profiles.integration.js +0 -2
- package/lib/mutations/profiles.js +0 -2
- package/lib/mutations/reactions.integration.js +0 -2
- package/lib/mutations/reactions.js +0 -2
- package/lib/mutations/statistics.integration.js +0 -2
- package/lib/mutations/statistics.js +0 -2
- package/lib/mutations/subscriptions.integration.js +0 -2
- package/lib/mutations/subscriptions.js +0 -2
- package/lib/mutations/tags.integration.js +0 -2
- package/lib/mutations/tags.js +0 -2
- package/lib/mutations/users.integration.js +0 -2
- package/lib/mutations/users.js +0 -2
- package/lib/objectTypes/app.js +0 -2
- package/lib/objectTypes/bankAccount.js +0 -2
- package/lib/objectTypes/connection.js +0 -2
- package/lib/objectTypes/conversation.js +0 -2
- package/lib/objectTypes/creditCard.js +0 -2
- package/lib/objectTypes/document.js +0 -2
- package/lib/objectTypes/error.js +0 -2
- package/lib/objectTypes/external.js +0 -2
- package/lib/objectTypes/file.js +0 -2
- package/lib/objectTypes/filter.js +0 -2
- package/lib/objectTypes/group.js +0 -2
- package/lib/objectTypes/iapSubscription.js +0 -2
- package/lib/objectTypes/image.js +0 -2
- package/lib/objectTypes/index.js +0 -2
- package/lib/objectTypes/location.js +0 -2
- package/lib/objectTypes/message.js +0 -2
- package/lib/objectTypes/passcode.js +0 -2
- package/lib/objectTypes/plan.js +0 -2
- package/lib/objectTypes/post.js +0 -2
- package/lib/objectTypes/profile.js +0 -2
- package/lib/objectTypes/reaction.js +0 -2
- package/lib/objectTypes/relation.js +0 -2
- package/lib/objectTypes/search.js +0 -2
- package/lib/objectTypes/statistics.js +0 -2
- package/lib/objectTypes/subscription.js +0 -2
- package/lib/objectTypes/tag.js +0 -2
- package/lib/objectTypes/user.js +0 -2
- package/lib/queries/index.js +0 -2
- package/lib/queries/locations.integration.js +0 -2
- package/lib/queries/locations.js +0 -2
- package/lib/queries/messages.integration.js +0 -2
- package/lib/queries/messages.js +0 -2
- package/lib/queries/posts.integration.js +0 -2
- package/lib/queries/posts.js +0 -2
- package/lib/queries/reactions.integration.js +0 -2
- package/lib/queries/reactions.js +0 -2
- package/lib/queries/statistics.js +0 -2
- package/lib/queries/subscriptions.js +0 -2
- package/lib/queries/tags.integration.js +0 -2
- package/lib/queries/tags.js +0 -2
- package/lib/queries/users.integration.js +0 -2
- package/lib/queries/users.js +0 -2
- package/lib/templates/email/layout.js +0 -280
- package/lib/templates/email/passwordForgot.js +0 -16
- package/lib/templates/email/passwordRecovery.js +0 -13
- package/lib/templates/email/verifyEmail.js +0 -16
- package/lib/templates/email/welcome.js +0 -16
- package/lib/templates/sms/passwordForgot.js +0 -2
- package/lib/templates/sms/passwordRecovery.js +0 -2
- package/lib/templates/sms/verifyEmail.js +0 -2
- package/lib/templates/sms/verifyPhone.js +0 -2
- package/lib/templates/sms/welcome.js +0 -2
- package/lib/types/apps.types.js +0 -2
- package/lib/types/arangodb.types.js +0 -1
- package/lib/types/auth.types.js +0 -1
- package/lib/types/connections.types.js +0 -1
- package/lib/types/content.types.js +0 -1
- package/lib/types/conversations.types.js +0 -1
- package/lib/types/email.types.js +0 -1
- package/lib/types/error.types.js +0 -2
- package/lib/types/files.types.js +0 -1
- package/lib/types/google.types.js +0 -1
- package/lib/types/groups.types.js +0 -1
- package/lib/types/images.types.js +0 -1
- package/lib/types/index.js +0 -2
- package/lib/types/locations.types.js +0 -1
- package/lib/types/messages.types.js +0 -1
- package/lib/types/notifications.types.js +0 -1
- package/lib/types/payments.types.js +0 -1
- package/lib/types/posts.types.js +0 -1
- package/lib/types/profiles.types.js +0 -1
- package/lib/types/statistics.types.js +0 -1
- package/lib/types/tags.types.js +0 -1
- package/lib/types/users.types.js +0 -1
- package/lib/types/websockets.types.js +0 -1
- package/lib/utils/adapterUtils.js +0 -2
- package/lib/utils/analyticsUtils.js +0 -2
- package/lib/utils/arangodbUtils.js +0 -7
- package/lib/utils/authUtils.js +0 -2
- package/lib/utils/contextUtils.js +0 -2
- package/lib/utils/dbI18n.example.js +0 -6
- package/lib/utils/dbI18n.js +0 -2
- package/lib/utils/googleTranslate.js +0 -2
- package/lib/utils/graphqlUtils.js +0 -2
- package/lib/utils/index.js +0 -2
- package/lib/utils/languageDetection.js +0 -2
- package/lib/utils/localeUtils.example.js +0 -2
- package/lib/utils/localeUtils.js +0 -2
- package/lib/utils/middlewareUtils.js +0 -2
- package/lib/utils/sessionUtils.js +0 -2
- package/lib/utils/stripeUtils.js +0 -2
- package/lib/utils/templateUtils.js +0 -2
- package/lib/utils/testUtils.js +0 -2
- package/lib/utils/translationQueue.example.js +0 -2
- package/lib/utils/translationQueue.js +0 -2
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2019-Present, Nitrogen Labs, Inc.
|
|
3
|
+
* Copyrights licensed under the MIT License. See the accompanying LICENSE file for terms.
|
|
4
|
+
*/
|
|
5
|
+
import type { QueryFilter } from './apps.types.js';
|
|
6
|
+
import type { DocumentType } from './arangodb.types.js';
|
|
7
|
+
import type { Locale } from './content.types.js';
|
|
8
|
+
import type { TagType } from './tags.types.js';
|
|
9
|
+
import type { Reaction } from '../actions/reactions.js';
|
|
10
|
+
import type { UserAccess } from '../actions/users.js';
|
|
11
|
+
export interface UserType extends DocumentType {
|
|
12
|
+
readonly active?: boolean;
|
|
13
|
+
readonly bankAccount?: string;
|
|
14
|
+
readonly bankFullName?: string;
|
|
15
|
+
readonly bankId?: string;
|
|
16
|
+
readonly bankRouting?: string;
|
|
17
|
+
readonly city?: string;
|
|
18
|
+
readonly country?: string;
|
|
19
|
+
readonly currency?: string;
|
|
20
|
+
readonly deviceToken?: string;
|
|
21
|
+
readonly dob?: number;
|
|
22
|
+
readonly email?: string;
|
|
23
|
+
readonly expires?: number;
|
|
24
|
+
readonly first?: string;
|
|
25
|
+
readonly gender?: string;
|
|
26
|
+
readonly imageId?: string;
|
|
27
|
+
readonly imageUrl?: string;
|
|
28
|
+
readonly ip?: string;
|
|
29
|
+
readonly last?: string;
|
|
30
|
+
readonly lastActive?: number;
|
|
31
|
+
readonly locale?: Locale;
|
|
32
|
+
readonly mailingList?: boolean;
|
|
33
|
+
readonly name?: string;
|
|
34
|
+
readonly password?: string;
|
|
35
|
+
readonly phone?: string;
|
|
36
|
+
readonly salt?: string;
|
|
37
|
+
readonly state?: string;
|
|
38
|
+
readonly street1?: string;
|
|
39
|
+
readonly street2?: string;
|
|
40
|
+
readonly stripeAccountId?: string;
|
|
41
|
+
readonly stripeCustomerId?: string;
|
|
42
|
+
readonly tags?: TagType[];
|
|
43
|
+
readonly thumbId?: string;
|
|
44
|
+
readonly thumbUrl?: string;
|
|
45
|
+
readonly timezone?: string;
|
|
46
|
+
readonly token?: string;
|
|
47
|
+
readonly type?: string;
|
|
48
|
+
readonly userAccess?: UserAccess;
|
|
49
|
+
readonly userId?: string;
|
|
50
|
+
readonly username?: string;
|
|
51
|
+
readonly verifiedEmail?: boolean;
|
|
52
|
+
readonly verifiedEmailCode?: number;
|
|
53
|
+
readonly verifiedEmailExpires?: number;
|
|
54
|
+
readonly verifiedPhone?: boolean;
|
|
55
|
+
readonly verifiedPhoneExpires?: number;
|
|
56
|
+
readonly verifiedSmsCode?: number;
|
|
57
|
+
readonly zip?: string;
|
|
58
|
+
}
|
|
59
|
+
export type UserPaymentType = {
|
|
60
|
+
readonly ssn?: string;
|
|
61
|
+
};
|
|
62
|
+
export type UserInput = {
|
|
63
|
+
readonly active?: boolean;
|
|
64
|
+
readonly bankAccount?: string;
|
|
65
|
+
readonly bankFullName?: string;
|
|
66
|
+
readonly bankId?: string;
|
|
67
|
+
readonly bankRouting?: string;
|
|
68
|
+
readonly city?: string;
|
|
69
|
+
readonly currency?: string;
|
|
70
|
+
readonly confirm?: string;
|
|
71
|
+
readonly country?: string;
|
|
72
|
+
readonly deviceToken?: string;
|
|
73
|
+
readonly dob?: number;
|
|
74
|
+
readonly email?: string;
|
|
75
|
+
readonly expires?: number;
|
|
76
|
+
readonly first?: string;
|
|
77
|
+
readonly gender?: string;
|
|
78
|
+
readonly imageId?: string;
|
|
79
|
+
readonly imageUrl?: string;
|
|
80
|
+
readonly ip?: string;
|
|
81
|
+
readonly last?: string;
|
|
82
|
+
readonly lastActive?: number;
|
|
83
|
+
readonly locale?: Locale;
|
|
84
|
+
readonly mailingList?: boolean;
|
|
85
|
+
readonly name?: string;
|
|
86
|
+
readonly password?: string;
|
|
87
|
+
readonly phone?: string;
|
|
88
|
+
readonly recaptcha?: string;
|
|
89
|
+
readonly state?: string;
|
|
90
|
+
readonly street1?: string;
|
|
91
|
+
readonly street2?: string;
|
|
92
|
+
readonly stripeAccountId?: string;
|
|
93
|
+
readonly stripeCustomerId?: string;
|
|
94
|
+
readonly tags?: TagType[];
|
|
95
|
+
readonly thumbId?: string;
|
|
96
|
+
readonly thumbUrl?: string;
|
|
97
|
+
readonly timezone?: string;
|
|
98
|
+
readonly userAccess?: UserAccess;
|
|
99
|
+
readonly userId?: string;
|
|
100
|
+
readonly username?: string;
|
|
101
|
+
readonly zip?: string;
|
|
102
|
+
};
|
|
103
|
+
export type UserReactionQuery = Reaction & {
|
|
104
|
+
readonly filters?: QueryFilter[];
|
|
105
|
+
};
|
|
106
|
+
export type PasscodeType = {
|
|
107
|
+
readonly passAttempt?: number;
|
|
108
|
+
readonly passExpires?: number;
|
|
109
|
+
readonly passcode?: string;
|
|
110
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2019-Present, Nitrogen Labs, Inc.
|
|
3
|
+
* Copyrights licensed under the MIT License. See the accompanying LICENSE file for terms.
|
|
4
|
+
*/
|
|
5
|
+
import type { PutObjectCommandInput } from '@aws-sdk/client-s3';
|
|
6
|
+
import type { ArangoDbCollection, EdgeType } from './arangodb.types.js';
|
|
7
|
+
import type { FileType } from './files.types.js';
|
|
8
|
+
export interface VideoType extends FileType {
|
|
9
|
+
readonly bucket?: string;
|
|
10
|
+
readonly durationMs?: number;
|
|
11
|
+
readonly externalId?: string;
|
|
12
|
+
readonly externalUrl?: string;
|
|
13
|
+
readonly height?: number;
|
|
14
|
+
readonly posterId?: string;
|
|
15
|
+
readonly provider?: 'youtube' | 'vimeo' | 'other';
|
|
16
|
+
readonly s3Options?: PutObjectCommandInput;
|
|
17
|
+
readonly streamType?: 'hls' | 'progressive';
|
|
18
|
+
readonly thumb?: string;
|
|
19
|
+
readonly fileType?: string;
|
|
20
|
+
readonly transcoded?: boolean;
|
|
21
|
+
readonly type?: 'video' | 'external';
|
|
22
|
+
readonly url?: string;
|
|
23
|
+
readonly videoId?: string;
|
|
24
|
+
readonly width?: number;
|
|
25
|
+
}
|
|
26
|
+
export type VideoUrlData = {
|
|
27
|
+
readonly bucket?: string;
|
|
28
|
+
readonly directory?: string;
|
|
29
|
+
readonly isThumb?: boolean;
|
|
30
|
+
readonly type?: ArangoDbCollection;
|
|
31
|
+
readonly typeId?: string;
|
|
32
|
+
readonly urlType?: 'dev' | 'public' | 'signed';
|
|
33
|
+
readonly videoDir?: string;
|
|
34
|
+
readonly videoId?: string;
|
|
35
|
+
readonly userId?: string;
|
|
36
|
+
};
|
|
37
|
+
export type VideoEdgeType = EdgeType & {
|
|
38
|
+
readonly itemId?: string;
|
|
39
|
+
readonly itemType?: ArangoDbCollection;
|
|
40
|
+
readonly videoId?: string;
|
|
41
|
+
};
|
|
42
|
+
export type VideoOptions = {
|
|
43
|
+
readonly from?: number;
|
|
44
|
+
readonly to?: number;
|
|
45
|
+
readonly type?: string;
|
|
46
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2019-Present, Nitrogen Labs, Inc.
|
|
3
|
+
* Copyrights licensed under the MIT License. See the accompanying LICENSE file for terms.
|
|
4
|
+
*/
|
|
5
|
+
import type { DocumentType } from './arangodb.types.js';
|
|
6
|
+
export interface WebsocketConnection {
|
|
7
|
+
_key: string;
|
|
8
|
+
socketId: string;
|
|
9
|
+
userId: string;
|
|
10
|
+
}
|
|
11
|
+
export interface WebsocketMessageType extends DocumentType {
|
|
12
|
+
readonly added?: number;
|
|
13
|
+
readonly content?: string;
|
|
14
|
+
readonly conversationId?: string;
|
|
15
|
+
readonly files?: string[];
|
|
16
|
+
readonly images?: string[];
|
|
17
|
+
readonly messageId?: string;
|
|
18
|
+
readonly modified?: number;
|
|
19
|
+
readonly read?: boolean;
|
|
20
|
+
readonly saved?: boolean;
|
|
21
|
+
readonly userId?: string;
|
|
22
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2019-Present, Nitrogen Labs, Inc.
|
|
3
|
+
* Copyrights licensed under the MIT License. See the accompanying LICENSE file for terms.
|
|
4
|
+
*/
|
|
5
|
+
import type { ApiContext } from '../types/auth.types.js';
|
|
6
|
+
export type ReaktorError = Error & {
|
|
7
|
+
readonly column?: number;
|
|
8
|
+
readonly line?: number;
|
|
9
|
+
readonly message?: string;
|
|
10
|
+
readonly source?: string;
|
|
11
|
+
};
|
|
12
|
+
export type ReaktorLogParams = {
|
|
13
|
+
readonly action?: string;
|
|
14
|
+
readonly category?: string;
|
|
15
|
+
readonly label?: string;
|
|
16
|
+
readonly params?: Record<string, unknown>;
|
|
17
|
+
readonly value?: string;
|
|
18
|
+
};
|
|
19
|
+
export declare const IsUserError: unique symbol;
|
|
20
|
+
export declare class UserError extends Error {
|
|
21
|
+
constructor(...args: any[]);
|
|
22
|
+
}
|
|
23
|
+
export declare const logError: (params: ReaktorLogParams, error?: ReaktorError, context?: ApiContext) => Promise<unknown>;
|
|
24
|
+
export declare const logException: (params: ReaktorLogParams, context: ApiContext) => Promise<unknown>;
|
|
25
|
+
export declare const logInfo: (params: any) => void;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2019-Present, Nitrogen Labs, Inc.
|
|
3
|
+
* Copyrights licensed under the MIT License. See the accompanying LICENSE file for terms.
|
|
4
|
+
*/
|
|
5
|
+
import { Database } from 'arangojs';
|
|
6
|
+
import type { ArangoDbCollection, ArangoDbLimit } from '../types/arangodb.types.js';
|
|
7
|
+
export declare const useDb: (databaseName?: string) => Database;
|
|
8
|
+
export declare const collectionDetails: {
|
|
9
|
+
apps: {
|
|
10
|
+
collection: string;
|
|
11
|
+
key: string;
|
|
12
|
+
};
|
|
13
|
+
conversations: {
|
|
14
|
+
collection: string;
|
|
15
|
+
key: string;
|
|
16
|
+
};
|
|
17
|
+
files: {
|
|
18
|
+
collection: string;
|
|
19
|
+
key: string;
|
|
20
|
+
};
|
|
21
|
+
groups: {
|
|
22
|
+
collection: string;
|
|
23
|
+
key: string;
|
|
24
|
+
};
|
|
25
|
+
images: {
|
|
26
|
+
collection: string;
|
|
27
|
+
key: string;
|
|
28
|
+
};
|
|
29
|
+
locations: {
|
|
30
|
+
collection: string;
|
|
31
|
+
key: string;
|
|
32
|
+
};
|
|
33
|
+
messages: {
|
|
34
|
+
collection: string;
|
|
35
|
+
key: string;
|
|
36
|
+
};
|
|
37
|
+
notifications: {
|
|
38
|
+
collection: string;
|
|
39
|
+
key: string;
|
|
40
|
+
};
|
|
41
|
+
payments: {
|
|
42
|
+
collection: string;
|
|
43
|
+
key: string;
|
|
44
|
+
};
|
|
45
|
+
posts: {
|
|
46
|
+
collection: string;
|
|
47
|
+
key: string;
|
|
48
|
+
};
|
|
49
|
+
reactions: {
|
|
50
|
+
collection: string;
|
|
51
|
+
key: string;
|
|
52
|
+
};
|
|
53
|
+
subscriptions: {
|
|
54
|
+
collection: string;
|
|
55
|
+
key: string;
|
|
56
|
+
};
|
|
57
|
+
tags: {
|
|
58
|
+
collection: string;
|
|
59
|
+
key: string;
|
|
60
|
+
};
|
|
61
|
+
users: {
|
|
62
|
+
collection: string;
|
|
63
|
+
key: string;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
export declare const getDocId: (collection: ArangoDbCollection, item: any) => string;
|
|
67
|
+
export declare const getLimit: (start?: number, to?: number) => ArangoDbLimit;
|
|
68
|
+
export declare const selectReactionCountByType: (objectType: string, objectKey: string, field: string, selects: any) => any;
|
|
69
|
+
export declare const sortIds: (ids: string[], sort?: string) => string[];
|
|
70
|
+
export declare const getGqlFields: (info: any) => string[];
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { AppStage } from '../types/apps.types.js';
|
|
2
|
+
import type { ApiContext } from '../types/auth.types.js';
|
|
3
|
+
export type LambdaDataContext = {
|
|
4
|
+
accountId: 'accountId';
|
|
5
|
+
readonly requestId: string;
|
|
6
|
+
readonly requestTimeEpoch: number;
|
|
7
|
+
readonly resourceId: string;
|
|
8
|
+
readonly resourcePath: string;
|
|
9
|
+
readonly stage: AppStage;
|
|
10
|
+
};
|
|
11
|
+
export type LambdaData = {
|
|
12
|
+
readonly body?: string | object;
|
|
13
|
+
readonly 'body-json'?: string;
|
|
14
|
+
readonly context?: LambdaDataContext;
|
|
15
|
+
readonly requestContext?: object;
|
|
16
|
+
};
|
|
17
|
+
export declare const getLambdaData: (data: LambdaData | string) => {
|
|
18
|
+
body: any;
|
|
19
|
+
context: {};
|
|
20
|
+
};
|
|
21
|
+
export declare const parseJsonData: (data: any) => any;
|
|
22
|
+
export declare const isAuthenticated: (context: ApiContext, userId: string) => boolean;
|
|
23
|
+
export declare const createContext: (context: ApiContext, event: any) => Promise<ApiContext>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ApiContext } from '../types/auth.types.js';
|
|
2
|
+
import type { Locale } from '../types/content.types.js';
|
|
3
|
+
export declare const dbI18n: (context: ApiContext, key: string, fallbackContent: string, locale?: Locale) => Promise<string>;
|
|
4
|
+
export declare const dbI18nMultiple: (context: ApiContext, translations: Array<{
|
|
5
|
+
key: string;
|
|
6
|
+
fallback: string;
|
|
7
|
+
locale?: Locale;
|
|
8
|
+
}>) => Promise<string[]>;
|
|
9
|
+
export declare const dbI18nWithInterpolation: (context: ApiContext, key: string, fallbackContent: string, interpolation?: Record<string, any>, locale?: Locale) => Promise<string>;
|
|
10
|
+
export declare const dbI18nBatch: (context: ApiContext, keys: string[], fallbackMap: Record<string, string>, locale?: Locale) => Promise<Record<string, string>>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025-Present, Nitrogen Labs, Inc.
|
|
3
|
+
* Copyrights licensed under the MIT License. See the accompanying LICENSE file for terms.
|
|
4
|
+
*
|
|
5
|
+
* Example usage of the database-driven i18n system
|
|
6
|
+
*
|
|
7
|
+
* This demonstrates how to use the new i18n utility that fetches
|
|
8
|
+
* translations from the database with fallback support.
|
|
9
|
+
*/
|
|
10
|
+
import type { ApiContext } from '../types/auth.types.js';
|
|
11
|
+
import type { Locale } from '../types/content.types.js';
|
|
12
|
+
export declare function sendWelcomeSMS(context: ApiContext, username: string, phoneNumber: string): Promise<string>;
|
|
13
|
+
export declare function sendVerificationCode(context: ApiContext, code: string, locale?: Locale): Promise<string>;
|
|
14
|
+
export declare function generateWelcomeEmail(context: ApiContext, username: string, locale?: Locale): Promise<{
|
|
15
|
+
subject: string;
|
|
16
|
+
body: string;
|
|
17
|
+
}>;
|
|
18
|
+
export declare function generateNotificationMessages(context: ApiContext, locale?: Locale): Promise<Record<string, string>>;
|
|
19
|
+
export declare function getErrorMessage(context: ApiContext, errorCode: string, locale?: Locale): Promise<string>;
|
|
20
|
+
export declare function getUserGreeting(context: ApiContext, userLocale?: string): Promise<string>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025-Present, Nitrogen Labs, Inc.
|
|
3
|
+
* Copyrights licensed under the MIT License. See the accompanying LICENSE file for terms.
|
|
4
|
+
*/
|
|
5
|
+
export declare const translateText: (text: string, targetLanguage: string, sourceLanguage?: string) => Promise<string>;
|
|
6
|
+
export declare const translateBatch: (texts: string[], targetLanguage: string, sourceLanguage?: string) => Promise<string[]>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ApiContext } from '../types/auth.types.js';
|
|
2
|
+
export declare const getRequestedFields: (info: any) => string[];
|
|
3
|
+
export declare const enhanceContextWithFields: (baseContext: ApiContext) => (root: any, args: any, context: any, info: any) => {
|
|
4
|
+
fields: string[];
|
|
5
|
+
config?: import("../config.js").AppConfig;
|
|
6
|
+
context?: any;
|
|
7
|
+
databaseName?: string;
|
|
8
|
+
languageContext?: import("./languageDetection.js").LanguageDetectionContext;
|
|
9
|
+
session?: import("./sessionUtils.js").Session;
|
|
10
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2019-Present, Nitrogen Labs, Inc.
|
|
3
|
+
* Copyrights licensed under the MIT License. See the accompanying LICENSE file for terms.
|
|
4
|
+
*/
|
|
5
|
+
export * from './adapterUtils.js';
|
|
6
|
+
export * from './analyticsUtils.js';
|
|
7
|
+
export * from './arangodbUtils.js';
|
|
8
|
+
export * from './authUtils.js';
|
|
9
|
+
export * from './contextUtils.js';
|
|
10
|
+
export * from './dbI18n.js';
|
|
11
|
+
export * from './googleTranslate.js';
|
|
12
|
+
export * from './graphqlUtils.js';
|
|
13
|
+
export * from './languageDetection.js';
|
|
14
|
+
export * from './localeUtils.js';
|
|
15
|
+
export * from './middlewareUtils.js';
|
|
16
|
+
export * from './sessionUtils.js';
|
|
17
|
+
export * from './templateUtils.js';
|
|
18
|
+
export * from './translationQueue.js';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Locale } from '../types/content.types.js';
|
|
2
|
+
export interface LanguageDetectionContext {
|
|
3
|
+
acceptLanguage?: string;
|
|
4
|
+
ipCountry?: string;
|
|
5
|
+
phoneCountryCode?: string;
|
|
6
|
+
userPreference?: Locale;
|
|
7
|
+
}
|
|
8
|
+
export declare const detectLanguage: (context: LanguageDetectionContext) => Locale;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025-Present, Nitrogen Labs, Inc.
|
|
3
|
+
* Copyrights licensed under the MIT License. See the accompanying LICENSE file for terms.
|
|
4
|
+
*/
|
|
5
|
+
import type { Locale } from '../types/content.types.js';
|
|
6
|
+
export declare const extractLanguage: (locale: string) => string;
|
|
7
|
+
export declare const isRegionalLocale: (locale: string) => boolean;
|
|
8
|
+
export declare const getFallbackChain: (locale: string) => string[];
|
|
9
|
+
export declare const getPrimaryLanguages: () => string[];
|
|
10
|
+
export declare const isValidLocale: (locale: string) => locale is Locale;
|
|
11
|
+
export declare const getSupportedLocales: () => Locale[];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type Session = {
|
|
2
|
+
readonly errors?: string[];
|
|
3
|
+
readonly exp?: number;
|
|
4
|
+
readonly iat?: number;
|
|
5
|
+
readonly username?: string;
|
|
6
|
+
readonly userAccess?: number;
|
|
7
|
+
readonly userId: string;
|
|
8
|
+
};
|
|
9
|
+
export type SessionToken = {
|
|
10
|
+
readonly expires: number;
|
|
11
|
+
readonly issued: number;
|
|
12
|
+
readonly token: string;
|
|
13
|
+
readonly userId: string;
|
|
14
|
+
readonly username: string;
|
|
15
|
+
};
|
|
16
|
+
export declare const setSession: (session: Session) => string;
|
|
17
|
+
export declare const getSession: (token: string) => Session;
|
|
18
|
+
export declare const isAdminUser: (session?: Session) => boolean;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025-Present, Nitrogen Labs, Inc.
|
|
3
|
+
* Copyrights licensed under the MIT License. See the accompanying LICENSE file for terms.
|
|
4
|
+
*/
|
|
5
|
+
import stripe from 'stripe';
|
|
6
|
+
export declare const stripeApiVersion = "2025-09-30.clover";
|
|
7
|
+
export declare const getStripeClient: () => stripe;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025-Present, Nitrogen Labs, Inc.
|
|
3
|
+
* Copyrights licensed under the MIT License. See the accompanying LICENSE file for terms.
|
|
4
|
+
*/
|
|
5
|
+
import { jest } from '@jest/globals';
|
|
6
|
+
import type { GraphQLResolveInfo } from 'graphql';
|
|
7
|
+
import type { ApiContext } from '../types/auth.types.js';
|
|
8
|
+
type MockOverrides = Partial<Record<string, unknown>>;
|
|
9
|
+
type TestContext = Partial<ApiContext> & {
|
|
10
|
+
session?: Partial<{
|
|
11
|
+
userId: string;
|
|
12
|
+
username: string;
|
|
13
|
+
userAccess: number;
|
|
14
|
+
}>;
|
|
15
|
+
};
|
|
16
|
+
type TestArgs = Record<string, unknown>;
|
|
17
|
+
type TestReturnValue = unknown;
|
|
18
|
+
export declare const createMockContext: (overrides?: MockOverrides) => ApiContext;
|
|
19
|
+
export declare const createMockResolveInfo: (fieldName?: string) => GraphQLResolveInfo;
|
|
20
|
+
export declare const mockActionsModule: (modulePath: string, mockActions: Record<string, jest.Mock>) => Promise<void>;
|
|
21
|
+
export declare const mockObjectType: (modulePath: string, typeName: string) => Promise<void>;
|
|
22
|
+
export declare const createQueryTestSuite: (name: string, actionsPath: string, testCases: Array<{
|
|
23
|
+
name: string;
|
|
24
|
+
actionName: string;
|
|
25
|
+
args: TestArgs;
|
|
26
|
+
expectedCall: (context: TestContext, args: TestArgs) => TestArgs;
|
|
27
|
+
mockReturnValue: TestReturnValue;
|
|
28
|
+
errorCase?: boolean;
|
|
29
|
+
}>) => void;
|
|
30
|
+
export declare const createMutationTestSuite: (name: string, actionsPath: string, testCases: Array<{
|
|
31
|
+
name: string;
|
|
32
|
+
actionName: string;
|
|
33
|
+
args: TestArgs;
|
|
34
|
+
expectedCall: (context: TestContext, args: TestArgs) => TestArgs;
|
|
35
|
+
mockReturnValue: TestReturnValue;
|
|
36
|
+
requiresAuth?: boolean;
|
|
37
|
+
authUserId?: string;
|
|
38
|
+
}>) => void;
|
|
39
|
+
export declare const createIntegrationTestSuite: (name: string, actionsPath: string, objectTypePath: string, typeName: string, testCases: Array<{
|
|
40
|
+
name: string;
|
|
41
|
+
actionName: string;
|
|
42
|
+
args: TestArgs;
|
|
43
|
+
expectedCall: (context: TestContext, args: TestArgs) => TestArgs;
|
|
44
|
+
successReturnValue: TestReturnValue;
|
|
45
|
+
errorReturnValue: TestReturnValue;
|
|
46
|
+
testErrorCase: boolean;
|
|
47
|
+
}>) => void;
|
|
48
|
+
export declare const createMockUser: (overrides?: MockOverrides) => {
|
|
49
|
+
email: string;
|
|
50
|
+
firstName: string;
|
|
51
|
+
lastName: string;
|
|
52
|
+
userId: string;
|
|
53
|
+
username: string;
|
|
54
|
+
};
|
|
55
|
+
export declare const createMockPost: (overrides?: MockOverrides) => {
|
|
56
|
+
content: string;
|
|
57
|
+
createdAt: string;
|
|
58
|
+
postId: string;
|
|
59
|
+
userId: string;
|
|
60
|
+
};
|
|
61
|
+
export declare const createMockMessage: (overrides?: MockOverrides) => {
|
|
62
|
+
content: string;
|
|
63
|
+
conversationId: string;
|
|
64
|
+
createdAt: string;
|
|
65
|
+
messageId: string;
|
|
66
|
+
userId: string;
|
|
67
|
+
};
|
|
68
|
+
export declare const createMockReaction: (overrides?: MockOverrides) => {
|
|
69
|
+
createdAt: string;
|
|
70
|
+
postId: string;
|
|
71
|
+
reactionId: string;
|
|
72
|
+
type: string;
|
|
73
|
+
userId: string;
|
|
74
|
+
};
|
|
75
|
+
export declare const createMockTag: (overrides?: MockOverrides) => {
|
|
76
|
+
description: string;
|
|
77
|
+
name: string;
|
|
78
|
+
tagId: string;
|
|
79
|
+
};
|
|
80
|
+
export declare const setupCommonMocks: () => Promise<void>;
|
|
81
|
+
export declare const clearAllMocks: () => void;
|
|
82
|
+
export declare const createActionTestSuite: (name: string, actionsPath: string, testCases: Array<{
|
|
83
|
+
name: string;
|
|
84
|
+
actionName: string;
|
|
85
|
+
args: TestArgs;
|
|
86
|
+
mockQuery: jest.Mock;
|
|
87
|
+
expectedResult: TestReturnValue;
|
|
88
|
+
}>) => void;
|
|
89
|
+
export declare const createAdapterTestSuite: (name: string, adapterPath: string, testCases: any[]) => void;
|
|
90
|
+
export declare const createUtilsTestSuite: (name: string, utilsPath: string, testCases: Array<{
|
|
91
|
+
name: string;
|
|
92
|
+
input: TestArgs;
|
|
93
|
+
expectedOutput: TestReturnValue;
|
|
94
|
+
}>) => void;
|
|
95
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025-Present, Nitrogen Labs, Inc.
|
|
3
|
+
* Copyrights licensed under the MIT License. See the accompanying LICENSE file for terms.
|
|
4
|
+
*/
|
|
5
|
+
import type { ApiContext } from '../types/auth.types.js';
|
|
6
|
+
import type { Locale } from '../types/content.types.js';
|
|
7
|
+
interface TranslationObject {
|
|
8
|
+
key: string;
|
|
9
|
+
fallback?: string;
|
|
10
|
+
params?: Record<string, any>;
|
|
11
|
+
}
|
|
12
|
+
declare class TranslationQueue {
|
|
13
|
+
private batches;
|
|
14
|
+
private batchTimeout;
|
|
15
|
+
private maxBatchSize;
|
|
16
|
+
translate(context: ApiContext, translations: TranslationObject[], locale?: Locale): Promise<Record<string, string>>;
|
|
17
|
+
private getTranslation;
|
|
18
|
+
flush(): Promise<void>;
|
|
19
|
+
clear(): void;
|
|
20
|
+
private getBatchKey;
|
|
21
|
+
private processBatch;
|
|
22
|
+
private interpolate;
|
|
23
|
+
}
|
|
24
|
+
declare const translationQueue: TranslationQueue;
|
|
25
|
+
export declare const i18n: (context: ApiContext, translations: TranslationObject[], locale?: Locale) => Promise<Record<string, string>>;
|
|
26
|
+
export declare const flush: () => Promise<void>;
|
|
27
|
+
export declare const clear: () => void;
|
|
28
|
+
export type { TranslationObject };
|
|
29
|
+
export { translationQueue };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025-Present, Nitrogen Labs, Inc.
|
|
3
|
+
* Copyrights licensed under the MIT License. See the accompanying LICENSE file for terms.
|
|
4
|
+
*
|
|
5
|
+
* Example usage of the translation queue system with Google Translate integration
|
|
6
|
+
*
|
|
7
|
+
* This demonstrates how to use the new translation queue that automatically
|
|
8
|
+
* translates content using Google Translate API when needed.
|
|
9
|
+
*/
|
|
10
|
+
import type { ApiContext } from '../types/auth.types.js';
|
|
11
|
+
import type { Locale } from '../types/content.types.js';
|
|
12
|
+
export declare function getWelcomeMessages(context: ApiContext, locale?: Locale): Promise<Record<string, string>>;
|
|
13
|
+
export declare function getPersonalizedMessages(context: ApiContext, username: string, locale?: Locale): Promise<Record<string, string>>;
|
|
14
|
+
export declare function getMultiLanguageContent(context: ApiContext): Promise<Record<Locale, Record<string, string>>>;
|
|
15
|
+
export declare function getRobustTranslations(context: ApiContext, locale?: Locale): Promise<Record<string, string>>;
|
|
16
|
+
export declare function processLargeTranslationBatch(context: ApiContext, locale?: Locale): Promise<Record<string, string>>;
|
|
17
|
+
export declare function getErrorMessages(context: ApiContext, errorCode: string, locale?: Locale): Promise<Record<string, string>>;
|
|
18
|
+
export declare function generateEmailTemplate(context: ApiContext, userData: {
|
|
19
|
+
name: string;
|
|
20
|
+
email: string;
|
|
21
|
+
orderId: string;
|
|
22
|
+
total: number;
|
|
23
|
+
items: number;
|
|
24
|
+
}, locale?: Locale): Promise<{
|
|
25
|
+
subject: string;
|
|
26
|
+
greeting: string;
|
|
27
|
+
body: string;
|
|
28
|
+
footer: string;
|
|
29
|
+
}>;
|
|
30
|
+
export declare function getNotificationMessages(context: ApiContext, locale?: Locale): Promise<Record<string, string>>;
|
|
31
|
+
export declare function performanceComparison(context: ApiContext): Promise<Record<string, string>>;
|
|
32
|
+
export declare function getUserGreeting(context: ApiContext, userLocale?: string, username?: string): Promise<string>;
|
|
33
|
+
export declare function ensureAllTranslationsProcessed(): Promise<void>;
|