Merge branch 'main' into iain/ratelimiter-should-respect-configuration
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { db } from '@/db/knex'
|
||||
import { moduleLogger } from '@/logging/logging'
|
||||
import { moduleLogger } from '@/observability/logging'
|
||||
import { initializeEventListenerFactory } from '@/modules/accessrequests/services/eventListener'
|
||||
import { getStreamCollaboratorsFactory } from '@/modules/core/repositories/streams'
|
||||
import { publishNotification } from '@/modules/notifications/services/publication'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Optional, SpeckleModule } from '@/modules/shared/helpers/typeHelper'
|
||||
import { publishNotification } from '@/modules/notifications/services/publication'
|
||||
import { activitiesLogger, moduleLogger } from '@/logging/logging'
|
||||
import { activitiesLogger, moduleLogger } from '@/observability/logging'
|
||||
import { weeklyEmailDigestEnabled } from '@/modules/shared/helpers/envHelper'
|
||||
import { EventBus, getEventBus } from '@/modules/shared/services/eventBus'
|
||||
import { sendActivityNotificationsFactory } from '@/modules/activitystream/services/summary'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { SpeckleModule } from '@/modules/shared/helpers/typeHelper'
|
||||
import { moduleLogger } from '@/logging/logging'
|
||||
import { moduleLogger } from '@/observability/logging'
|
||||
import { readFile } from 'fs/promises'
|
||||
import { getFrontendOrigin } from '@/modules/shared/helpers/envHelper'
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { SpeckleModule } from '@/modules/shared/helpers/typeHelper'
|
||||
|
||||
import { registerOrUpdateScopeFactory } from '@/modules/shared/repositories/scopes'
|
||||
import { authLogger, moduleLogger } from '@/logging/logging'
|
||||
import { authLogger, moduleLogger } from '@/observability/logging'
|
||||
import db from '@/db/knex'
|
||||
import { initializeDefaultAppsFactory } from '@/modules/auth/services/serverApps'
|
||||
import {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { logger, moduleLogger } from '@/logging/logging'
|
||||
import { logger, moduleLogger } from '@/observability/logging'
|
||||
import { getDefaultApp } from '@/modules/auth/defaultApps'
|
||||
import {
|
||||
CreateApp,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { authLogger, type Logger } from '@/logging/logging'
|
||||
import { maybeLoggerWithContext } from '@/logging/requestContext'
|
||||
import { authLogger, type Logger } from '@/observability/logging'
|
||||
import { maybeLoggerWithContext } from '@/observability/components/express/requestContext'
|
||||
import {
|
||||
addToMailchimpAudience,
|
||||
triggerMailchimpCustomerJourney
|
||||
|
||||
@@ -56,7 +56,8 @@ import { RateLimiterMemory } from 'rate-limiter-flexible'
|
||||
import { TIME } from '@speckle/shared'
|
||||
import type { Application } from 'express'
|
||||
import { passportAuthenticationCallbackFactory } from '@/modules/auth/services/passportService'
|
||||
import { testLogger as logger } from '@/logging/logging'
|
||||
import { testLogger as logger } from '@/observability/logging'
|
||||
import { Application } from 'express'
|
||||
|
||||
const getServerInfo = getServerInfoFactory({ db })
|
||||
const getUser = getUserFactory({ db })
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { automateLogger } from '@/logging/logging'
|
||||
import { automateLogger } from '@/observability/logging'
|
||||
import {
|
||||
ExecutionEngineBadResponseBodyError,
|
||||
type ExecutionEngineErrorResponse,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { automateLogger, moduleLogger } from '@/logging/logging'
|
||||
import { automateLogger, moduleLogger } from '@/observability/logging'
|
||||
import { Optional, SpeckleModule } from '@/modules/shared/helpers/typeHelper'
|
||||
import {
|
||||
onModelVersionCreateFactory,
|
||||
@@ -58,7 +58,7 @@ import { getEventBus } from '@/modules/shared/services/eventBus'
|
||||
import { VersionEvents } from '@/modules/core/domain/commits/events'
|
||||
import { AutomationEvents, AutomationRunEvents } from '@/modules/automate/domain/events'
|
||||
import { LogicError } from '@/modules/shared/errors'
|
||||
import { maybeLoggerWithContext } from '@/logging/requestContext'
|
||||
import { maybeLoggerWithContext } from '@/observability/components/express/requestContext'
|
||||
|
||||
const { FF_AUTOMATE_MODULE_ENABLED } = getFeatureFlags()
|
||||
let quitListeners: Optional<() => void> = undefined
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { automateLogger } from '@/logging/logging'
|
||||
import { automateLogger } from '@/observability/logging'
|
||||
import { CreateStoredAuthCode } from '@/modules/automate/domain/operations'
|
||||
import { AutomateAuthCodeHandshakeError } from '@/modules/automate/errors/management'
|
||||
import { EventBus } from '@/modules/shared/services/eventBus'
|
||||
|
||||
@@ -43,7 +43,7 @@ import {
|
||||
speckleAutomateUrl
|
||||
} from '@/modules/shared/helpers/envHelper'
|
||||
import { getFunctionsMarketplaceUrl } from '@/modules/core/helpers/routeHelper'
|
||||
import { automateLogger } from '@/logging/logging'
|
||||
import { automateLogger } from '@/observability/logging'
|
||||
import { CreateStoredAuthCode } from '@/modules/automate/domain/operations'
|
||||
import { GetUser } from '@/modules/core/domain/users/operations'
|
||||
import { noop } from 'lodash'
|
||||
|
||||
@@ -25,7 +25,7 @@ import {
|
||||
import { TriggerAutomationError } from '@/modules/automate/errors/runs'
|
||||
import { ContextResourceAccessRules } from '@/modules/core/helpers/token'
|
||||
import { TokenResourceIdentifierType } from '@/modules/core/graph/generated/graphql'
|
||||
import { automateLogger } from '@/logging/logging'
|
||||
import { automateLogger } from '@/observability/logging'
|
||||
import { FunctionInputDecryptor } from '@/modules/automate/services/encryption'
|
||||
import { LibsodiumEncryptionError } from '@/modules/shared/errors/encryption'
|
||||
import {
|
||||
|
||||
@@ -15,7 +15,7 @@ import {
|
||||
ResourceMismatch,
|
||||
BadRequestError
|
||||
} from '@/modules/shared/errors'
|
||||
import { moduleLogger, logger } from '@/logging/logging'
|
||||
import { moduleLogger } from '@/observability/logging'
|
||||
import {
|
||||
getAllStreamBlobIdsFactory,
|
||||
upsertBlobFactory,
|
||||
@@ -68,7 +68,7 @@ const ensureConditions = async () => {
|
||||
}
|
||||
|
||||
if (!process.env.S3_BUCKET) {
|
||||
logger.warn(
|
||||
moduleLogger.warn(
|
||||
'S3_BUCKET env variable was not specified. 📦 BlobStorage will be DISABLED.'
|
||||
)
|
||||
return
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { CommandModule } from 'yargs'
|
||||
import { initializeQueue } from '@/modules/notifications/services/queue'
|
||||
import { publishNotification } from '@/modules/notifications/services/publication'
|
||||
import { cliLogger } from '@/logging/logging'
|
||||
import { cliLogger } from '@/observability/logging'
|
||||
import { sendActivityNotificationsFactory } from '@/modules/activitystream/services/summary'
|
||||
import { getActiveUserStreamsFactory } from '@/modules/activitystream/repositories'
|
||||
import { db } from '@/db/knex'
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
buildNotificationsQueue
|
||||
} from '@/modules/notifications/services/queue'
|
||||
import { noop } from 'lodash'
|
||||
import { cliLogger } from '@/logging/logging'
|
||||
import { cliLogger } from '@/observability/logging'
|
||||
|
||||
const PORT = 3032
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { cliLogger } from '@/logging/logging'
|
||||
import { cliLogger } from '@/observability/logging'
|
||||
import { NotificationType } from '@/modules/notifications/helpers/types'
|
||||
import { initializeConsumption } from '@/modules/notifications/index'
|
||||
import { EnvironmentResourceError } from '@/modules/shared/errors'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { cliLogger } from '@/logging/logging'
|
||||
import { cliLogger } from '@/observability/logging'
|
||||
import {
|
||||
MentionedInCommentData,
|
||||
NotificationType
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import knex from '@/db/knex'
|
||||
import { appRoot } from '@/bootstrap'
|
||||
import fs from 'fs/promises'
|
||||
import { logger } from '@/logging/logging'
|
||||
import { cliLogger as logger } from '@/observability/logging'
|
||||
import { CommandModule } from 'yargs'
|
||||
import { ensureError } from '@speckle/shared'
|
||||
import { MisconfiguredEnvironmentError } from '@/modules/shared/errors'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { logger } from '@/logging/logging'
|
||||
import { cliLogger as logger } from '@/observability/logging'
|
||||
import { CommonDbArgs, getTargettedDbClients } from '@/modules/cli/commands/db/helpers'
|
||||
import { CommandModule } from 'yargs'
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { logger } from '@/logging/logging'
|
||||
import { cliLogger as logger } from '@/observability/logging'
|
||||
import { CommonDbArgs, getTargettedDbClients } from '@/modules/cli/commands/db/helpers'
|
||||
import { CommandModule } from 'yargs'
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { logger } from '@/logging/logging'
|
||||
import { cliLogger as logger } from '@/observability/logging'
|
||||
import { CommonDbArgs, getTargettedDbClients } from '@/modules/cli/commands/db/helpers'
|
||||
import { resetPubSubFactory } from '@/test/hooks'
|
||||
import { CommandModule } from 'yargs'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { logger } from '@/logging/logging'
|
||||
import { cliLogger as logger } from '@/observability/logging'
|
||||
import { CommonDbArgs, getTargettedDbClients } from '@/modules/cli/commands/db/helpers'
|
||||
import { CommandModule } from 'yargs'
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { db } from '@/db/knex'
|
||||
import { cliLogger } from '@/logging/logging'
|
||||
import { cliLogger as logger } from '@/observability/logging'
|
||||
import { StreamNotFoundError } from '@/modules/core/errors/stream'
|
||||
import { UserNotFoundError } from '@/modules/core/errors/user'
|
||||
import { getStreamFactory } from '@/modules/core/repositories/streams'
|
||||
@@ -55,7 +55,7 @@ const command: CommandModule<
|
||||
)
|
||||
}
|
||||
|
||||
cliLogger.info(`Generating ${count} objects & commits for stream ${streamId}...`)
|
||||
logger.info(`Generating ${count} objects & commits for stream ${streamId}...`)
|
||||
await createTestCommits(
|
||||
times(
|
||||
count,
|
||||
@@ -68,7 +68,7 @@ const command: CommandModule<
|
||||
})
|
||||
)
|
||||
)
|
||||
cliLogger.info(`...done`)
|
||||
logger.info(`...done`)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { logger } from '@/logging/logging'
|
||||
import { cliLogger as logger } from '@/observability/logging'
|
||||
import { Users, ServerAcl } from '@/modules/core/dbSchema'
|
||||
import { Roles } from '@/modules/core/helpers/mainConstants'
|
||||
import { faker } from '@faker-js/faker'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { CommandModule } from 'yargs'
|
||||
import { downloadCommitFactory } from '@/modules/cross-server-sync/services/commit'
|
||||
import { cliLogger } from '@/logging/logging'
|
||||
import { cliLogger as logger } from '@/observability/logging'
|
||||
import {
|
||||
getStreamCollaboratorsFactory,
|
||||
getStreamFactory,
|
||||
@@ -181,7 +181,7 @@ const command: CommandModule<
|
||||
createCommentReplyAndNotify
|
||||
})
|
||||
|
||||
await downloadCommit(argv, { logger: cliLogger })
|
||||
await downloadCommit(argv, { logger })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { CommandModule } from 'yargs'
|
||||
import { cliLogger } from '@/logging/logging'
|
||||
import { cliLogger as logger } from '@/observability/logging'
|
||||
import { downloadProjectFactory } from '@/modules/cross-server-sync/services/project'
|
||||
import { downloadCommitFactory } from '@/modules/cross-server-sync/services/commit'
|
||||
import {
|
||||
@@ -226,7 +226,7 @@ const command: CommandModule<
|
||||
eventEmit: getEventBus().emit
|
||||
})
|
||||
})
|
||||
await downloadProject({ ...argv, regionKey }, { logger: cliLogger })
|
||||
await downloadProject({ ...argv, regionKey }, { logger })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { CommandModule } from 'yargs'
|
||||
import { cliLogger } from '@/logging/logging'
|
||||
import { cliLogger as logger } from '@/observability/logging'
|
||||
import * as ModulesSetup from '@/modules'
|
||||
import { printSchema } from 'graphql/utilities'
|
||||
import fs from 'node:fs/promises'
|
||||
@@ -17,11 +17,11 @@ const command: CommandModule<unknown, { file: string }> = {
|
||||
}
|
||||
},
|
||||
handler: async ({ file }) => {
|
||||
cliLogger.info('Loading GQL schema...')
|
||||
logger.info('Loading GQL schema...')
|
||||
const schema = ModulesSetup.graphSchema()
|
||||
const schemaString = printSchema(schema)
|
||||
|
||||
cliLogger.info(`Saving to "${file}"...`)
|
||||
logger.info(`Saving to "${file}"...`)
|
||||
const absolutePath = path.isAbsolute(file)
|
||||
? file
|
||||
: path.resolve(process.cwd(), file)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { db } from '@/db/knex'
|
||||
import { cliLogger } from '@/logging/logging'
|
||||
import { cliLogger as logger } from '@/observability/logging'
|
||||
import {
|
||||
getBatchedStreamCommentsFactory,
|
||||
getCommentLinksFactory,
|
||||
@@ -66,11 +66,11 @@ const command: CommandModule<
|
||||
emitEvent: getEventBus().emit
|
||||
})
|
||||
|
||||
cliLogger.info(
|
||||
logger.info(
|
||||
`Cloning stream ${sourceStreamId} into the account of user ${targetUserId}...`
|
||||
)
|
||||
const { id } = await cloneStream(targetUserId, sourceStreamId)
|
||||
cliLogger.info('Cloning successful! New stream ID: ' + id)
|
||||
logger.info('Cloning successful! New stream ID: ' + id)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { CommandModule } from 'yargs'
|
||||
import { cliLogger } from '@/logging/logging'
|
||||
import { cliLogger as logger } from '@/observability/logging'
|
||||
import { metaHelpers } from '@/modules/core/helpers/meta'
|
||||
import { Users } from '@/modules/core/dbSchema'
|
||||
import { UserRecord, UsersMetaRecord } from '@/modules/core/helpers/types'
|
||||
@@ -9,28 +9,28 @@ const command: CommandModule = {
|
||||
command: 'test-meta',
|
||||
describe: 'Testing users meta behaviour',
|
||||
handler: async () => {
|
||||
cliLogger.info('Hello world!')
|
||||
logger.info('Hello world!')
|
||||
|
||||
const testUsers = await Users.knex<UserRecord[]>().limit(5)
|
||||
const firstUserId = testUsers[0]?.id
|
||||
const secondUserId = testUsers[1]?.id
|
||||
if (!firstUserId || !secondUserId) {
|
||||
cliLogger.error('One or more test users were not found')
|
||||
logger.error('One or more test users were not found')
|
||||
return
|
||||
}
|
||||
|
||||
const meta = metaHelpers<UsersMetaRecord, typeof Users>(Users, db)
|
||||
|
||||
// set value
|
||||
cliLogger.info(await meta.set(firstUserId, 'foo', false))
|
||||
cliLogger.info(await meta.set(firstUserId, 'bar', "I'm happy to see ya brodie'!\""))
|
||||
cliLogger.info(await meta.set(secondUserId, 'foo', { a: 123 }))
|
||||
logger.info(await meta.set(firstUserId, 'foo', false))
|
||||
logger.info(await meta.set(firstUserId, 'bar', "I'm happy to see ya brodie'!\""))
|
||||
logger.info(await meta.set(secondUserId, 'foo', { a: 123 }))
|
||||
|
||||
// get value
|
||||
cliLogger.info(await meta.get<UsersMetaRecord<string>>(firstUserId, 'bar'))
|
||||
logger.info(await meta.get<UsersMetaRecord<string>>(firstUserId, 'bar'))
|
||||
|
||||
// get multiple values
|
||||
cliLogger.info(
|
||||
logger.info(
|
||||
await meta.getMultiple([
|
||||
{ id: firstUserId, key: 'foo' },
|
||||
{ id: firstUserId, key: 'bar' },
|
||||
@@ -40,7 +40,7 @@ const command: CommandModule = {
|
||||
)
|
||||
|
||||
// delete value
|
||||
cliLogger.info(await meta.delete(firstUserId, 'bar'))
|
||||
logger.info(await meta.delete(firstUserId, 'bar'))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { CommandModule } from 'yargs'
|
||||
import { cliLogger } from '@/logging/logging'
|
||||
import { cliLogger as logger } from '@/observability/logging'
|
||||
import { getWorkspaceBySlugOrIdFactory } from '@/modules/workspaces/repositories/workspaces'
|
||||
import { db } from '@/db/knex'
|
||||
import { upsertPaidWorkspacePlanFactory } from '@/modules/gatekeeper/repositories/billing'
|
||||
@@ -42,7 +42,7 @@ const command: CommandModule<
|
||||
}
|
||||
},
|
||||
handler: async (args) => {
|
||||
cliLogger.info(
|
||||
logger.info(
|
||||
`Setting plan for workspace '${args.workspaceSlugOrId}' to '${args.plan}' with status '${args.status}'`
|
||||
)
|
||||
const workspace = await getWorkspaceBySlugOrIdFactory({ db })(args)
|
||||
@@ -60,7 +60,7 @@ const command: CommandModule<
|
||||
status: args.status
|
||||
}
|
||||
})
|
||||
cliLogger.info(`Plan set!`)
|
||||
logger.info(`Plan set!`)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import path from 'path'
|
||||
import yargs from 'yargs'
|
||||
import '../../bootstrap'
|
||||
import { cliLogger, logger } from '@/logging/logging'
|
||||
import { cliLogger as logger } from '@/observability/logging'
|
||||
import { isTestEnv } from '@/modules/shared/helpers/envHelper'
|
||||
import { mochaHooks } from '@/test/hooks'
|
||||
|
||||
@@ -23,7 +23,7 @@ const main = async () => {
|
||||
|
||||
// In test env, run beforeAll hooks to properly initialize everything first
|
||||
if (isBeforeAllSet && isTestEnv()) {
|
||||
cliLogger.info('Running test beforeAll hooks...')
|
||||
logger.info('Running test beforeAll hooks...')
|
||||
await (mochaHooks.beforeAll as () => Promise<void>)()
|
||||
}
|
||||
})
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { db } from '@/db/knex'
|
||||
import { moduleLogger } from '@/logging/logging'
|
||||
import { moduleLogger } from '@/observability/logging'
|
||||
import { saveActivityFactory } from '@/modules/activitystream/repositories'
|
||||
import { reportSubscriptionEventsFactory } from '@/modules/comments/events/subscriptionListeners'
|
||||
import { getCommentsResourcesFactory } from '@/modules/comments/repositories/comments'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Logger } from '@/logging/logging'
|
||||
import type { Logger } from '@/observability/logging'
|
||||
import {
|
||||
InsertableSpeckleObject,
|
||||
RawSpeckleObject,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
/* eslint-disable camelcase */
|
||||
import { type Registry, Counter } from 'prom-client'
|
||||
import { graphqlLogger } from '@/logging/logging'
|
||||
import { redactSensitiveVariables } from '@/logging/loggingHelper'
|
||||
import { graphqlLogger } from '@/observability/logging'
|
||||
import { redactSensitiveVariables } from '@/observability/utils/redact'
|
||||
import { FieldNode, SelectionNode } from 'graphql'
|
||||
import { ApolloServerPlugin } from '@apollo/server'
|
||||
import { GraphQLContext } from '@/modules/shared/helpers/typeHelper'
|
||||
import { shouldLogAsInfoLevel } from '@/logging/graphqlError'
|
||||
import { getRequestContext } from '@/logging/requestContext'
|
||||
import { shouldLogAsInfoLevel } from '@/observability/utils/logLevels'
|
||||
import { getRequestContext } from '@/observability/components/express/requestContext'
|
||||
|
||||
type ApolloLoggingPluginTransaction = {
|
||||
start: number
|
||||
|
||||
@@ -35,7 +35,7 @@ import {
|
||||
deleteStreamFactory,
|
||||
getUserDeletableStreamsFactory
|
||||
} from '@/modules/core/repositories/streams'
|
||||
import { dbLogger } from '@/logging/logging'
|
||||
import { dbLogger } from '@/observability/logging'
|
||||
import { getAdminUsersListCollectionFactory } from '@/modules/core/services/users/legacyAdminUsersList'
|
||||
import { Resolvers } from '@/modules/core/graph/generated/graphql'
|
||||
import { getServerInfoFactory } from '@/modules/core/repositories/server'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { moduleLogger } from '@/logging/logging'
|
||||
import { moduleLogger } from '@/observability/logging'
|
||||
import {
|
||||
setupResultListener,
|
||||
shutdownResultListener
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
import { extendLoggerComponent, moduleLogger } from '@/logging/logging'
|
||||
import { extendLoggerComponent, moduleLogger } from '@/observability/logging'
|
||||
|
||||
export const coreLogger = extendLoggerComponent(moduleLogger, 'core')
|
||||
|
||||
@@ -5,7 +5,7 @@ import { Optional, ensureError } from '@speckle/shared'
|
||||
import { ErrorRequestHandler } from 'express'
|
||||
import { get, isNumber } from 'lodash'
|
||||
import { VError } from 'verror'
|
||||
import { logger as defaultLogger } from '@/logging/logging'
|
||||
import { logger as defaultLogger } from '@/observability/logging'
|
||||
|
||||
export const resolveStatusCode = (e: Error): number => {
|
||||
if (e instanceof BaseError) {
|
||||
|
||||
@@ -3,7 +3,6 @@ import { corsMiddlewareFactory } from '@/modules/core/configs/cors'
|
||||
|
||||
import { SpeckleObjectsStream } from '@/modules/core/rest/speckleObjectsStream'
|
||||
import { pipeline, PassThrough } from 'stream'
|
||||
import { logger } from '@/logging/logging'
|
||||
import {
|
||||
getFormattedObjectFactory,
|
||||
getObjectChildrenStreamFactory
|
||||
@@ -25,7 +24,7 @@ export default (app: express.Express) => {
|
||||
app.options('/objects/:streamId/:objectId', corsMiddlewareFactory())
|
||||
|
||||
app.get('/objects/:streamId/:objectId', corsMiddlewareFactory(), async (req, res) => {
|
||||
const boundLogger = (req.log || logger).child({
|
||||
const boundLogger = req.log.child({
|
||||
requestId: req.id,
|
||||
userId: req.context.userId || '-',
|
||||
streamId: req.params.streamId,
|
||||
@@ -112,7 +111,7 @@ export default (app: express.Express) => {
|
||||
'/objects/:streamId/:objectId/single',
|
||||
corsMiddlewareFactory(),
|
||||
async (req, res) => {
|
||||
const boundLogger = (req.log || logger).child({
|
||||
const boundLogger = req.log.child({
|
||||
requestId: req.id,
|
||||
userId: req.context.userId || '-',
|
||||
streamId: req.params.streamId,
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
estimateStringMegabyteSize
|
||||
} from '@/modules/core/utils/chunking'
|
||||
import { ObjectHandlingError } from '@/modules/core/errors/object'
|
||||
import { servicesLogger } from '@/logging/logging'
|
||||
import { servicesLogger } from '@/observability/logging'
|
||||
import {
|
||||
CreateObject,
|
||||
CreateObjects,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import cron from 'node-cron'
|
||||
import { InvalidArgumentError } from '@/modules/shared/errors'
|
||||
import { logger } from '@/logging/logging'
|
||||
import { taskSchedulerLogger as logger } from '@/observability/logging'
|
||||
import {
|
||||
AcquireTaskLock,
|
||||
ReleaseTaskLock,
|
||||
|
||||
@@ -48,7 +48,7 @@ import {
|
||||
DeleteStreamRecord,
|
||||
GetUserDeletableStreams
|
||||
} from '@/modules/core/domain/streams/operations'
|
||||
import { Logger } from '@/logging/logging'
|
||||
import type { Logger } from '@/observability/logging'
|
||||
import { DeleteAllUserInvites } from '@/modules/serverinvites/domain/operations'
|
||||
import { GetServerInfo } from '@/modules/core/domain/server/operations'
|
||||
import { EventBusEmit } from '@/modules/shared/services/eventBus'
|
||||
|
||||
@@ -96,7 +96,7 @@ import {
|
||||
} from '@/modules/core/services/users/management'
|
||||
import { validateAndCreateUserEmailFactory } from '@/modules/core/services/userEmails'
|
||||
import { finalizeInvitedServerRegistrationFactory } from '@/modules/serverinvites/services/processing'
|
||||
import { dbLogger } from '@/logging/logging'
|
||||
import { dbLogger } from '@/observability/logging'
|
||||
import {
|
||||
storeApiTokenFactory,
|
||||
storeTokenScopesFactory,
|
||||
|
||||
@@ -40,7 +40,7 @@ import {
|
||||
deleteStreamFactory,
|
||||
getUserDeletableStreamsFactory
|
||||
} from '@/modules/core/repositories/streams'
|
||||
import { dbLogger } from '@/logging/logging'
|
||||
import { dbLogger } from '@/observability/logging'
|
||||
import { getServerInfoFactory } from '@/modules/core/repositories/server'
|
||||
import { getEventBus } from '@/modules/shared/services/eventBus'
|
||||
import { expect } from 'chai'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { MaybeAsync, Optional, md5, wait } from '@speckle/shared'
|
||||
import { dbNotificationLogger } from '@/logging/logging'
|
||||
import { dbNotificationLogger } from '@/observability/logging'
|
||||
import { knex } from '@/modules/core/dbSchema'
|
||||
import * as Knex from 'knex'
|
||||
import * as pg from 'pg'
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
RateLimiterRes
|
||||
} from 'rate-limiter-flexible'
|
||||
import { Nullable, TIME } from '@speckle/shared'
|
||||
import { rateLimiterLogger } from '@/logging/logging'
|
||||
import { rateLimiterLogger } from '@/observability/logging'
|
||||
import { createRedisClient } from '@/modules/shared/redis/redis'
|
||||
import { RateLimitError } from '@/modules/core/errors/ratelimit'
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { type Logger } from '@/logging/logging'
|
||||
import { type Logger } from '@/observability/logging'
|
||||
import { StreamRecord } from '@/modules/core/helpers/types'
|
||||
|
||||
export type DownloadCommit = (
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { db } from '@/db/knex'
|
||||
import { moduleLogger, crossServerSyncLogger } from '@/logging/logging'
|
||||
import { moduleLogger, crossServerSyncLogger } from '@/observability/logging'
|
||||
import { getBlobsFactory } from '@/modules/blobstorage/repositories'
|
||||
import {
|
||||
getCommentFactory,
|
||||
|
||||
@@ -5,7 +5,7 @@ import { CreateCommentInput } from '@/test/graphql/generated/graphql'
|
||||
import { Roles, timeoutAt } from '@speckle/shared'
|
||||
import ObjectLoader from '@speckle/objectloader'
|
||||
import { noop } from 'lodash'
|
||||
import { crossServerSyncLogger } from '@/logging/logging'
|
||||
import { crossServerSyncLogger } from '@/observability/logging'
|
||||
import type { SpeckleViewer } from '@speckle/shared'
|
||||
import { retry } from '@speckle/shared'
|
||||
import {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { crossServerSyncLogger } from '@/logging/logging'
|
||||
import { crossServerSyncLogger } from '@/observability/logging'
|
||||
import {
|
||||
GetOnboardingBaseStream,
|
||||
MarkOnboardingBaseStream
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { crossServerSyncLogger, Logger } from '@/logging/logging'
|
||||
import { crossServerSyncLogger, Logger } from '@/observability/logging'
|
||||
import { CrossServerProjectSyncError } from '@/modules/cross-server-sync/errors'
|
||||
import {
|
||||
createApolloClient,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* istanbul ignore file */
|
||||
import { moduleLogger } from '@/logging/logging'
|
||||
import { moduleLogger } from '@/observability/logging'
|
||||
import * as SendingService from '@/modules/emails/services/sending'
|
||||
import { initializeTransporter } from '@/modules/emails/utils/transporter'
|
||||
import { SpeckleModule } from '@/modules/shared/helpers/typeHelper'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { logger } from '@/logging/logging'
|
||||
import { emailLogger as logger } from '@/observability/logging'
|
||||
import { SendEmail, SendEmailParams } from '@/modules/emails/domain/operations'
|
||||
import { getTransporter } from '@/modules/emails/utils/transporter'
|
||||
import { getEmailFromAddress } from '@/modules/shared/helpers/envHelper'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { logger, moduleLogger } from '@/logging/logging'
|
||||
import { emailLogger as logger } from '@/observability/logging'
|
||||
import { MisconfiguredEnvironmentError } from '@/modules/shared/errors'
|
||||
import { isEmailEnabled, isTestEnv } from '@/modules/shared/helpers/envHelper'
|
||||
import { createTransport, Transporter } from 'nodemailer'
|
||||
@@ -37,7 +37,7 @@ export async function initializeTransporter(): Promise<Transporter | undefined>
|
||||
if (!newTransporter) {
|
||||
const message =
|
||||
'📧 Email provider is enabled but transport has not initialized correctly. Please review the email configuration or your email system for problems.'
|
||||
moduleLogger.error(message)
|
||||
logger.error(message)
|
||||
throw new MisconfiguredEnvironmentError(message)
|
||||
}
|
||||
}
|
||||
@@ -47,13 +47,13 @@ export async function initializeTransporter(): Promise<Transporter | undefined>
|
||||
if (!newTransporter) {
|
||||
const message =
|
||||
'📧 In testing a mock email provider is enabled but transport has not initialized correctly.'
|
||||
moduleLogger.error(message)
|
||||
logger.error(message)
|
||||
throw new MisconfiguredEnvironmentError(message)
|
||||
}
|
||||
}
|
||||
|
||||
if (!newTransporter) {
|
||||
moduleLogger.warn(
|
||||
logger.warn(
|
||||
'📧 Email provider is not configured. Server functionality will be limited.'
|
||||
)
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { insertNewUploadAndNotifyFactory } from '@/modules/fileuploads/services/management'
|
||||
import request from 'request'
|
||||
import { authMiddlewareCreator } from '@/modules/shared/middleware'
|
||||
import { moduleLogger } from '@/logging/logging'
|
||||
import { moduleLogger } from '@/observability/logging'
|
||||
import {
|
||||
onFileImportProcessedFactory,
|
||||
onFileProcessingFactory,
|
||||
|
||||
@@ -12,7 +12,7 @@ import { GetFileInfo } from '@/modules/fileuploads/domain/operations'
|
||||
import { GetStreamBranchByName } from '@/modules/core/domain/branches/operations'
|
||||
import { EventBusEmit } from '@/modules/shared/services/eventBus'
|
||||
import { ModelEvents } from '@/modules/core/domain/branches/events'
|
||||
import { fileUploadsLogger as logger } from '@/logging/logging'
|
||||
import { fileUploadsLogger as logger } from '@/observability/logging'
|
||||
import { FileUploadConvertedStatus } from '@/modules/fileuploads/helpers/types'
|
||||
import { FileUploadInternalError } from '@/modules/fileuploads/helpers/errors'
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import cron from 'node-cron'
|
||||
import { logger, moduleLogger } from '@/logging/logging'
|
||||
import { logger, moduleLogger } from '@/observability/logging'
|
||||
import { SpeckleModule } from '@/modules/shared/helpers/typeHelper'
|
||||
import { getFeatureFlags } from '@/modules/shared/helpers/envHelper'
|
||||
import { validateModuleLicense } from '@/modules/gatekeeper/services/validateLicense'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Logger } from '@/logging/logging'
|
||||
import type { Logger } from '@/observability/logging'
|
||||
import {
|
||||
GetWorkspacePlan,
|
||||
GetWorkspacePlanPrice,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { logger } from '@/logging/logging'
|
||||
import { testLogger as logger } from '@/observability/logging'
|
||||
import {
|
||||
SubscriptionData,
|
||||
SubscriptionDataInput,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { SpeckleModule } from '@/modules/shared/helpers/typeHelper'
|
||||
import { moduleLogger } from '@/logging/logging'
|
||||
import { moduleLogger } from '@/observability/logging'
|
||||
import { getFeatureFlags } from '@/modules/shared/helpers/envHelper'
|
||||
import restApi from '@/modules/gendo/rest/index'
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import { values, merge, camelCase, reduce, intersection } from 'lodash'
|
||||
import baseTypeDefs from '@/modules/core/graph/schema/baseTypeDefs'
|
||||
import { scalarResolvers } from '@/modules/core/graph/scalars'
|
||||
import { makeExecutableSchema } from '@graphql-tools/schema'
|
||||
import { moduleLogger } from '@/logging/logging'
|
||||
import { moduleLogger } from '@/observability/logging'
|
||||
import { addMocksToSchema } from '@graphql-tools/mock'
|
||||
import { getFeatureFlags } from '@/modules/shared/helpers/envHelper'
|
||||
import { isNonNullable } from '@speckle/shared'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { moduleLogger } from '@/logging/logging'
|
||||
import { moduleLogger } from '@/observability/logging'
|
||||
import {
|
||||
getValidDefaultProjectRegionKey,
|
||||
initializeRegisteredRegionClients as initDb
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
} from '@/modules/notifications/helpers/types'
|
||||
import { SpeckleModule } from '@/modules/shared/helpers/typeHelper'
|
||||
import { shouldDisableNotificationsConsumption } from '@/modules/shared/helpers/envHelper'
|
||||
import { moduleLogger } from '@/logging/logging'
|
||||
import { moduleLogger } from '@/observability/logging'
|
||||
|
||||
export async function initializeConsumption(
|
||||
customHandlers?: Partial<NotificationTypeHandlers>
|
||||
|
||||
@@ -16,7 +16,7 @@ import { isProdEnv, isTestEnv } from '@/modules/shared/helpers/envHelper'
|
||||
import Bull from 'bull'
|
||||
import { buildBaseQueueOptions } from '@/modules/shared/helpers/bullHelper'
|
||||
import cryptoRandomString from 'crypto-random-string'
|
||||
import { logger, notificationsLogger, Observability } from '@/logging/logging'
|
||||
import { logger, notificationsLogger, Observability } from '@/observability/logging'
|
||||
import { ensureErrorOrWrapAsCause } from '@/modules/shared/errors/ensureError'
|
||||
|
||||
export type NotificationJobResult = {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { validateScopes, authorizeResolver } from '@/modules/shared'
|
||||
|
||||
import { makeOgImage } from '@/modules/previews/ogImage'
|
||||
import { moduleLogger } from '@/logging/logging'
|
||||
import { moduleLogger } from '@/observability/logging'
|
||||
import { messageProcessor } from '@/modules/previews/resultListener'
|
||||
import { db } from '@/db/knex'
|
||||
import {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { moduleLogger } from '@/logging/logging'
|
||||
import { moduleLogger } from '@/observability/logging'
|
||||
import RestSetup from '@/modules/pwdreset/rest'
|
||||
import { SpeckleModule } from '@/modules/shared/helpers/typeHelper'
|
||||
import { noop } from 'lodash'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { registerOrUpdateScopeFactory } from '@/modules/shared/repositories/scopes'
|
||||
import { moduleLogger } from '@/logging/logging'
|
||||
import { moduleLogger } from '@/observability/logging'
|
||||
import db from '@/db/knex'
|
||||
import { Scopes } from '@speckle/shared'
|
||||
import { SpeckleModule } from '@/modules/shared/helpers/typeHelper'
|
||||
|
||||
@@ -33,7 +33,7 @@ import { Netmask } from 'netmask'
|
||||
import { Merge } from 'type-fest'
|
||||
import { resourceAccessRuleToIdentifier } from '@/modules/core/helpers/token'
|
||||
import { delayGraphqlResponsesBy } from '@/modules/shared/helpers/envHelper'
|
||||
import { subscriptionLogger } from '@/logging/logging'
|
||||
import { subscriptionLogger } from '@/observability/logging'
|
||||
import { GetUser } from '@/modules/core/domain/users/operations'
|
||||
import { validateTokenFactory } from '@/modules/core/services/tokens'
|
||||
import {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { redisLogger } from '@/logging/logging'
|
||||
import { redisLogger } from '@/observability/logging'
|
||||
import Redis, { RedisOptions } from 'ioredis'
|
||||
import {
|
||||
EnvironmentResourceError,
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
import Mixpanel from 'mixpanel'
|
||||
import type express from 'express'
|
||||
import type http from 'http'
|
||||
import { mixpanelLogger } from '@/logging/logging'
|
||||
import { mixpanelLogger } from '@/observability/logging'
|
||||
|
||||
let client: Optional<Mixpanel.Mixpanel> = undefined
|
||||
let baseTrackingProperties: Optional<Record<string, string>> = undefined
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { moduleLogger } from '@/logging/logging'
|
||||
import { moduleLogger } from '@/observability/logging'
|
||||
import { SpeckleModule } from '@/modules/shared/helpers/typeHelper'
|
||||
|
||||
export const init: SpeckleModule['init'] = async () => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import cron from 'node-cron'
|
||||
import { SpeckleModule } from '@/modules/shared/helpers/typeHelper'
|
||||
import { activitiesLogger, moduleLogger } from '@/logging/logging'
|
||||
import { activitiesLogger, moduleLogger } from '@/observability/logging'
|
||||
import { scheduleExecutionFactory } from '@/modules/core/services/taskScheduler'
|
||||
import {
|
||||
acquireTaskLockFactory,
|
||||
|
||||
@@ -21,7 +21,7 @@ import {
|
||||
isProjectResourceTarget,
|
||||
resolveTarget
|
||||
} from '@/modules/serverinvites/helpers/core'
|
||||
import { logger, moduleLogger } from '@/logging/logging'
|
||||
import { logger, moduleLogger } from '@/observability/logging'
|
||||
import { updateWorkspaceRoleFactory } from '@/modules/workspaces/services/management'
|
||||
import { EventPayload, getEventBus } from '@/modules/shared/services/eventBus'
|
||||
import { WorkspaceInviteResourceType } from '@/modules/workspacesCore/domain/constants'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { moduleLogger } from '@/logging/logging'
|
||||
import { moduleLogger } from '@/observability/logging'
|
||||
import { getFeatureFlags } from '@/modules/shared/helpers/envHelper'
|
||||
import { registerOrUpdateScopeFactory } from '@/modules/shared/repositories/scopes'
|
||||
import db from '@/db/knex'
|
||||
|
||||
@@ -38,7 +38,7 @@ import {
|
||||
getEmailFromOidcProfile,
|
||||
isValidSsoSession
|
||||
} from '@/modules/workspaces/domain/sso/logic'
|
||||
import { Logger } from '@/logging/logging'
|
||||
import type { Logger } from '@/observability/logging'
|
||||
|
||||
// this probably should go a lean validation endpoint too
|
||||
const validateOidcProviderAttributes = ({
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { SpeckleModule } from '@/modules/shared/helpers/typeHelper'
|
||||
import { moduleLogger } from '@/logging/logging'
|
||||
import { moduleLogger } from '@/observability/logging'
|
||||
|
||||
export const init: SpeckleModule['init'] = () => {
|
||||
moduleLogger.info('⚒️ Init workspaces core module')
|
||||
|
||||
Reference in New Issue
Block a user