diff --git a/docs/apps-engine-migration.md b/docs/apps-engine-migration.md index 048690599b0d9..9e39dca694aaa 100644 --- a/docs/apps-engine-migration.md +++ b/docs/apps-engine-migration.md @@ -25,3 +25,4 @@ To make this migration easier to understand and review, we're using a stacked PR - [40395](https://github.com/RocketChat/Rocket.Chat/pull/40395) The feature branch itself. It will accumulate the changes of the whole stack. - [40183](https://github.com/RocketChat/Rocket.Chat/pull/40183) Replaces `AppPackageParser.getEngineVersion()` - which resolved the version by traversing the filesystem relative to `__dirname` - with a direct import of `ENGINE_VERSION`. This will support the migration of the `AppPackageParser` class itself. - [40184](https://github.com/RocketChat/Rocket.Chat/pull/40184) Copies all relevant source files from `packages/apps-engine/src/server`, `packages/apps-engine/src/client`, `packages/apps-engine/deno-runtime`, `packages/apps-engine/tests` and `packages/apps-engine/scripts` into their corresponding path at `packages/apps`. +- [40185](https://github.com/RocketChat/Rocket.Chat/pull/40185) Adapts the path resolution of the apps-engine package for the deno runtime diff --git a/packages/apps/.gitignore b/packages/apps/.gitignore index 6275ba88f1b7e..718c7da4c4944 100644 --- a/packages/apps/.gitignore +++ b/packages/apps/.gitignore @@ -1,2 +1,5 @@ .deno-cache/ /tests/test-data/dbs + +# File generated at runtime +deno.runtime.jsonc diff --git a/packages/apps/deno-runtime/deno.jsonc b/packages/apps/deno-runtime/deno.jsonc index 4fa3142b99261..d19a3daac7d92 100644 --- a/packages/apps/deno-runtime/deno.jsonc +++ b/packages/apps/deno-runtime/deno.jsonc @@ -1,8 +1,9 @@ { "imports": { "@msgpack/msgpack": "npm:@msgpack/msgpack@3.0.0-beta2", - "@rocket.chat/apps-engine/": "./../src/", "@rocket.chat/ui-kit": "npm:@rocket.chat/ui-kit@^0.31.22", + "@rocket.chat/apps-engine/": "../../../packages/apps-engine/", + "@rocket.chat/apps/": "../", "@std/cli": "jsr:@std/cli@^1.0.9", "@std/io": "jsr:@std/io@^0.225.3", "@std/streams": "jsr:@std/streams@^1.0.16", @@ -13,7 +14,7 @@ "stack-trace": "npm:stack-trace@0.0.10", "uuid": "npm:uuid@8.3.2" }, - "unstable": ["detect-cjs"], + "unstable": ["detect-cjs","sloppy-imports"], "tasks": { "test": "deno test --no-check --allow-read=../../../,/tmp --allow-write=/tmp" }, @@ -22,5 +23,10 @@ "useTabs": true, "indentWidth": 4, "singleQuote": true + }, + "lint": { + "rules": { + "exclude": ["no-sloppy-imports"] + } } } diff --git a/packages/apps/deno-runtime/handlers/api-handler.ts b/packages/apps/deno-runtime/handlers/api-handler.ts index 1b88a92551ea7..d014366c99d1f 100644 --- a/packages/apps/deno-runtime/handlers/api-handler.ts +++ b/packages/apps/deno-runtime/handlers/api-handler.ts @@ -1,4 +1,4 @@ -import type { IApiEndpoint } from '@rocket.chat/apps-engine/definition/api/IApiEndpoint.ts'; +import type { IApiEndpoint } from '@rocket.chat/apps-engine/definition/api/IApiEndpoint'; import { Defined, JsonRpcError } from 'jsonrpc-lite'; import { AppObjectRegistry } from '../AppObjectRegistry.ts'; diff --git a/packages/apps/deno-runtime/handlers/app/construct.ts b/packages/apps/deno-runtime/handlers/app/construct.ts index b391088fee217..7ad0baeb7823b 100644 --- a/packages/apps/deno-runtime/handlers/app/construct.ts +++ b/packages/apps/deno-runtime/handlers/app/construct.ts @@ -1,6 +1,6 @@ import { Socket } from 'node:net'; -import type { IParseAppPackageResult } from '@rocket.chat/apps-engine/server/compiler/IParseAppPackageResult.ts'; +import type { IParseAppPackageResult } from '@rocket.chat/apps/dist/server/compiler/IParseAppPackageResult'; import { AppObjectRegistry } from '../../AppObjectRegistry.ts'; import { require } from '../../lib/require.ts'; diff --git a/packages/apps/deno-runtime/handlers/app/handleGetStatus.ts b/packages/apps/deno-runtime/handlers/app/handleGetStatus.ts index 8bd454b98ca7f..30c78d2430904 100644 --- a/packages/apps/deno-runtime/handlers/app/handleGetStatus.ts +++ b/packages/apps/deno-runtime/handlers/app/handleGetStatus.ts @@ -1,4 +1,4 @@ -import type { App } from '@rocket.chat/apps-engine/definition/App.ts'; +import type { App } from '@rocket.chat/apps-engine/definition/App'; import { AppObjectRegistry } from '../../AppObjectRegistry.ts'; diff --git a/packages/apps/deno-runtime/handlers/app/handleInitialize.ts b/packages/apps/deno-runtime/handlers/app/handleInitialize.ts index e8ee4ed1de136..4be65241c8f56 100644 --- a/packages/apps/deno-runtime/handlers/app/handleInitialize.ts +++ b/packages/apps/deno-runtime/handlers/app/handleInitialize.ts @@ -1,4 +1,4 @@ -import type { App } from '@rocket.chat/apps-engine/definition/App.ts'; +import type { App } from '@rocket.chat/apps-engine/definition/App'; import { AppObjectRegistry } from '../../AppObjectRegistry.ts'; import { AppAccessorsInstance } from '../../lib/accessors/mod.ts'; diff --git a/packages/apps/deno-runtime/handlers/app/handleOnDisable.ts b/packages/apps/deno-runtime/handlers/app/handleOnDisable.ts index ffac456cd9bc9..170f25f326009 100644 --- a/packages/apps/deno-runtime/handlers/app/handleOnDisable.ts +++ b/packages/apps/deno-runtime/handlers/app/handleOnDisable.ts @@ -1,4 +1,4 @@ -import type { App } from '@rocket.chat/apps-engine/definition/App.ts'; +import type { App } from '@rocket.chat/apps-engine/definition/App'; import { AppObjectRegistry } from '../../AppObjectRegistry.ts'; import { AppAccessorsInstance } from '../../lib/accessors/mod.ts'; diff --git a/packages/apps/deno-runtime/handlers/app/handleOnEnable.ts b/packages/apps/deno-runtime/handlers/app/handleOnEnable.ts index 34c1d49b0f367..320d5772a01d0 100644 --- a/packages/apps/deno-runtime/handlers/app/handleOnEnable.ts +++ b/packages/apps/deno-runtime/handlers/app/handleOnEnable.ts @@ -1,4 +1,4 @@ -import type { App } from '@rocket.chat/apps-engine/definition/App.ts'; +import type { App } from '@rocket.chat/apps-engine/definition/App'; import { AppObjectRegistry } from '../../AppObjectRegistry.ts'; import { AppAccessorsInstance } from '../../lib/accessors/mod.ts'; diff --git a/packages/apps/deno-runtime/handlers/app/handleOnInstall.ts b/packages/apps/deno-runtime/handlers/app/handleOnInstall.ts index d6e4ada5cf6f0..d779728bc0c9c 100644 --- a/packages/apps/deno-runtime/handlers/app/handleOnInstall.ts +++ b/packages/apps/deno-runtime/handlers/app/handleOnInstall.ts @@ -1,4 +1,4 @@ -import type { App } from '@rocket.chat/apps-engine/definition/App.ts'; +import type { App } from '@rocket.chat/apps-engine/definition/App'; import { AppObjectRegistry } from '../../AppObjectRegistry.ts'; import { AppAccessorsInstance } from '../../lib/accessors/mod.ts'; diff --git a/packages/apps/deno-runtime/handlers/app/handleOnPreSettingUpdate.ts b/packages/apps/deno-runtime/handlers/app/handleOnPreSettingUpdate.ts index 601e1429be025..301dd5aa7f2c8 100644 --- a/packages/apps/deno-runtime/handlers/app/handleOnPreSettingUpdate.ts +++ b/packages/apps/deno-runtime/handlers/app/handleOnPreSettingUpdate.ts @@ -1,4 +1,4 @@ -import type { App } from '@rocket.chat/apps-engine/definition/App.ts'; +import type { App } from '@rocket.chat/apps-engine/definition/App'; import { AppObjectRegistry } from '../../AppObjectRegistry.ts'; import { AppAccessorsInstance } from '../../lib/accessors/mod.ts'; diff --git a/packages/apps/deno-runtime/handlers/app/handleOnSettingUpdated.ts b/packages/apps/deno-runtime/handlers/app/handleOnSettingUpdated.ts index e78ece63dda92..7a2111cbfd990 100644 --- a/packages/apps/deno-runtime/handlers/app/handleOnSettingUpdated.ts +++ b/packages/apps/deno-runtime/handlers/app/handleOnSettingUpdated.ts @@ -1,4 +1,4 @@ -import type { App } from '@rocket.chat/apps-engine/definition/App.ts'; +import type { App } from '@rocket.chat/apps-engine/definition/App'; import { AppObjectRegistry } from '../../AppObjectRegistry.ts'; import { AppAccessorsInstance } from '../../lib/accessors/mod.ts'; diff --git a/packages/apps/deno-runtime/handlers/app/handleOnUninstall.ts b/packages/apps/deno-runtime/handlers/app/handleOnUninstall.ts index 34b02c2b45f1f..7901f21f903b2 100644 --- a/packages/apps/deno-runtime/handlers/app/handleOnUninstall.ts +++ b/packages/apps/deno-runtime/handlers/app/handleOnUninstall.ts @@ -1,4 +1,4 @@ -import type { App } from '@rocket.chat/apps-engine/definition/App.ts'; +import type { App } from '@rocket.chat/apps-engine/definition/App'; import { AppObjectRegistry } from '../../AppObjectRegistry.ts'; import { AppAccessorsInstance } from '../../lib/accessors/mod.ts'; diff --git a/packages/apps/deno-runtime/handlers/app/handleOnUpdate.ts b/packages/apps/deno-runtime/handlers/app/handleOnUpdate.ts index 0eb8643c928f4..65f7986e0cef3 100644 --- a/packages/apps/deno-runtime/handlers/app/handleOnUpdate.ts +++ b/packages/apps/deno-runtime/handlers/app/handleOnUpdate.ts @@ -1,4 +1,4 @@ -import type { App } from '@rocket.chat/apps-engine/definition/App.ts'; +import type { App } from '@rocket.chat/apps-engine/definition/App'; import { AppObjectRegistry } from '../../AppObjectRegistry.ts'; import { AppAccessorsInstance } from '../../lib/accessors/mod.ts'; diff --git a/packages/apps/deno-runtime/handlers/app/handleSetStatus.ts b/packages/apps/deno-runtime/handlers/app/handleSetStatus.ts index 163fa3684ae67..136e8ccc6271d 100644 --- a/packages/apps/deno-runtime/handlers/app/handleSetStatus.ts +++ b/packages/apps/deno-runtime/handlers/app/handleSetStatus.ts @@ -1,5 +1,5 @@ -import type { App } from '@rocket.chat/apps-engine/definition/App.ts'; -import type { AppStatus as _AppStatus } from '@rocket.chat/apps-engine/definition/AppStatus.ts'; +import type { App } from '@rocket.chat/apps-engine/definition/App'; +import type { AppStatus as _AppStatus } from '@rocket.chat/apps-engine/definition/AppStatus'; import { AppObjectRegistry } from '../../AppObjectRegistry.ts'; import { require } from '../../lib/require.ts'; diff --git a/packages/apps/deno-runtime/handlers/app/handleUploadEvents.ts b/packages/apps/deno-runtime/handlers/app/handleUploadEvents.ts index 72d58801d537c..1e203dca5d6b4 100644 --- a/packages/apps/deno-runtime/handlers/app/handleUploadEvents.ts +++ b/packages/apps/deno-runtime/handlers/app/handleUploadEvents.ts @@ -1,9 +1,9 @@ import { Buffer } from 'node:buffer'; -import type { App } from '@rocket.chat/apps-engine/definition/App.ts'; -import { AppsEngineException } from '@rocket.chat/apps-engine/definition/exceptions/AppsEngineException.ts'; -import type { IFileUploadContext } from '@rocket.chat/apps-engine/definition/uploads/IFileUploadContext.ts' -import type { IUploadDetails } from '@rocket.chat/apps-engine/definition/uploads/IUploadDetails.ts' +import type { App } from '@rocket.chat/apps-engine/definition/App'; +import { AppsEngineException } from '@rocket.chat/apps-engine/definition/exceptions/AppsEngineException'; +import type { IFileUploadContext } from '@rocket.chat/apps-engine/definition/uploads/IFileUploadContext' +import type { IUploadDetails } from '@rocket.chat/apps-engine/definition/uploads/IUploadDetails' import { toArrayBuffer } from '@std/streams'; import { Defined, JsonRpcError } from 'jsonrpc-lite'; diff --git a/packages/apps/deno-runtime/handlers/lib/assertions.ts b/packages/apps/deno-runtime/handlers/lib/assertions.ts index d6dcd0a4c9651..d2668840fb4bc 100644 --- a/packages/apps/deno-runtime/handlers/lib/assertions.ts +++ b/packages/apps/deno-runtime/handlers/lib/assertions.ts @@ -1,4 +1,4 @@ -import type { App } from '@rocket.chat/apps-engine/definition/App.ts'; +import type { App } from '@rocket.chat/apps-engine/definition/App'; import { JsonRpcError } from 'jsonrpc-lite'; /** diff --git a/packages/apps/deno-runtime/handlers/listener/handler.ts b/packages/apps/deno-runtime/handlers/listener/handler.ts index 88bc09b81403d..5dc98dea614c7 100644 --- a/packages/apps/deno-runtime/handlers/listener/handler.ts +++ b/packages/apps/deno-runtime/handlers/listener/handler.ts @@ -1,7 +1,7 @@ -import type { App } from '@rocket.chat/apps-engine/definition/App.ts'; -import type { IMessage } from '@rocket.chat/apps-engine/definition/messages/IMessage.ts'; -import type { IRoom } from '@rocket.chat/apps-engine/definition/rooms/IRoom.ts'; -import type { AppsEngineException as _AppsEngineException } from '@rocket.chat/apps-engine/definition/exceptions/AppsEngineException.ts'; +import type { App } from '@rocket.chat/apps-engine/definition/App'; +import type { IMessage } from '@rocket.chat/apps-engine/definition/messages/IMessage'; +import type { IRoom } from '@rocket.chat/apps-engine/definition/rooms/IRoom'; +import type { AppsEngineException as _AppsEngineException } from '@rocket.chat/apps-engine/definition/exceptions/AppsEngineException'; import { Defined, JsonRpcError } from 'jsonrpc-lite'; import { AppObjectRegistry } from '../../AppObjectRegistry.ts'; diff --git a/packages/apps/deno-runtime/handlers/outboundcomms-handler.ts b/packages/apps/deno-runtime/handlers/outboundcomms-handler.ts index cb425e61684f5..1c4dee24dd025 100644 --- a/packages/apps/deno-runtime/handlers/outboundcomms-handler.ts +++ b/packages/apps/deno-runtime/handlers/outboundcomms-handler.ts @@ -1,4 +1,4 @@ -import type { IOutboundMessageProviders } from '@rocket.chat/apps-engine/definition/outboundCommunication/IOutboundCommsProvider.ts'; +import type { IOutboundMessageProviders } from '@rocket.chat/apps-engine/definition/outboundCommunication/IOutboundCommsProvider'; import { JsonRpcError, Defined } from 'jsonrpc-lite'; import { AppObjectRegistry } from '../AppObjectRegistry.ts'; diff --git a/packages/apps/deno-runtime/handlers/scheduler-handler.ts b/packages/apps/deno-runtime/handlers/scheduler-handler.ts index 23c969ed46131..9b6dfcad14d3b 100644 --- a/packages/apps/deno-runtime/handlers/scheduler-handler.ts +++ b/packages/apps/deno-runtime/handlers/scheduler-handler.ts @@ -1,5 +1,5 @@ -import type { App } from '@rocket.chat/apps-engine/definition/App.ts'; -import type { IProcessor } from '@rocket.chat/apps-engine/definition/scheduler/IProcessor.ts'; +import type { App } from '@rocket.chat/apps-engine/definition/App'; +import type { IProcessor } from '@rocket.chat/apps-engine/definition/scheduler/IProcessor'; import { Defined, JsonRpcError } from 'jsonrpc-lite'; import { AppObjectRegistry } from '../AppObjectRegistry.ts'; diff --git a/packages/apps/deno-runtime/handlers/slashcommand-handler.ts b/packages/apps/deno-runtime/handlers/slashcommand-handler.ts index de1a9ecd1efe1..52e3c1419d913 100644 --- a/packages/apps/deno-runtime/handlers/slashcommand-handler.ts +++ b/packages/apps/deno-runtime/handlers/slashcommand-handler.ts @@ -1,21 +1,14 @@ -import type { IRoom } from '@rocket.chat/apps-engine/definition/rooms/IRoom.ts'; -import type { ISlashCommand } from '@rocket.chat/apps-engine/definition/slashcommands/ISlashCommand.ts'; -import type { SlashCommandContext as _SlashCommandContext } from '@rocket.chat/apps-engine/definition/slashcommands/SlashCommandContext.ts'; -import type { Room as _Room } from '@rocket.chat/apps-engine/server/rooms/Room.ts'; +import type { IRoom } from '@rocket.chat/apps-engine/definition/rooms/IRoom'; +import type { ISlashCommand } from '@rocket.chat/apps-engine/definition/slashcommands/ISlashCommand'; +import { SlashCommandContext } from '@rocket.chat/apps-engine/definition/slashcommands/SlashCommandContext'; import { Defined, JsonRpcError } from 'jsonrpc-lite'; import { AppObjectRegistry } from '../AppObjectRegistry.ts'; import { AppAccessors, AppAccessorsInstance } from '../lib/accessors/mod.ts'; -import { require } from '../lib/require.ts'; import createRoom from '../lib/roomFactory.ts'; import { RequestContext } from '../lib/requestContext.ts'; import { wrapComposedApp } from '../lib/wrapAppForRequest.ts'; -// For some reason Deno couldn't understand the typecast to the original interfaces and said it wasn't a constructor type -const { SlashCommandContext } = require('@rocket.chat/apps-engine/definition/slashcommands/SlashCommandContext.js') as { - SlashCommandContext: typeof _SlashCommandContext; -}; - export default async function slashCommandHandler(request: RequestContext): Promise { const { method: call, params } = request; const { logger } = request.context; @@ -76,11 +69,11 @@ export function handleExecutor(deps: Deps, command: ISlashCommand, method: 'exec const { sender, room, params: args, threadId, triggerId } = params[0] as Record; const context = new SlashCommandContext( - sender as _SlashCommandContext['sender'], + sender as SlashCommandContext['sender'], createRoom(room as IRoom, deps.AppAccessorsInstance.getSenderFn()), - args as _SlashCommandContext['params'], - threadId as _SlashCommandContext['threadId'], - triggerId as _SlashCommandContext['triggerId'], + args as SlashCommandContext['params'], + threadId as SlashCommandContext['threadId'], + triggerId as SlashCommandContext['triggerId'], ); return executor.apply(wrapComposedApp(command, deps.request), [ @@ -109,11 +102,11 @@ export function handlePreviewItem(deps: Deps, command: ISlashCommand, params: un const [previewItem, { sender, room, params: args, threadId, triggerId }] = params as [Record, Record]; const context = new SlashCommandContext( - sender as _SlashCommandContext['sender'], + sender as SlashCommandContext['sender'], createRoom(room as IRoom, deps.AppAccessorsInstance.getSenderFn()), - args as _SlashCommandContext['params'], - threadId as _SlashCommandContext['threadId'], - triggerId as _SlashCommandContext['triggerId'], + args as SlashCommandContext['params'], + threadId as SlashCommandContext['threadId'], + triggerId as SlashCommandContext['triggerId'], ); return command.executePreviewItem.call( diff --git a/packages/apps/deno-runtime/handlers/tests/api-handler.test.ts b/packages/apps/deno-runtime/handlers/tests/api-handler.test.ts index 26ccbd43fb80f..70f68082bdab3 100644 --- a/packages/apps/deno-runtime/handlers/tests/api-handler.test.ts +++ b/packages/apps/deno-runtime/handlers/tests/api-handler.test.ts @@ -1,5 +1,5 @@ // deno-lint-ignore-file no-explicit-any -import type { IApiEndpoint } from '@rocket.chat/apps-engine/definition/api/IApiEndpoint.ts'; +import type { IApiEndpoint } from '@rocket.chat/apps-engine/definition/api/IApiEndpoint'; import { assertEquals, assertObjectMatch } from 'https://deno.land/std@0.203.0/assert/mod.ts'; import { beforeEach, describe, it } from 'https://deno.land/std@0.203.0/testing/bdd.ts'; import { spy } from 'https://deno.land/std@0.203.0/testing/mock.ts'; diff --git a/packages/apps/deno-runtime/handlers/tests/helpers/mod.ts b/packages/apps/deno-runtime/handlers/tests/helpers/mod.ts index 581d95e4c3484..0bd5d97489489 100644 --- a/packages/apps/deno-runtime/handlers/tests/helpers/mod.ts +++ b/packages/apps/deno-runtime/handlers/tests/helpers/mod.ts @@ -1,4 +1,4 @@ -import type { App } from '@rocket.chat/apps-engine/definition/App.ts'; +import type { App } from '@rocket.chat/apps-engine/definition/App'; import { Logger } from '../../../lib/logger.ts'; import { RequestDescriptor } from '../../../lib/messenger.ts'; diff --git a/packages/apps/deno-runtime/handlers/tests/upload-event-handler.test.ts b/packages/apps/deno-runtime/handlers/tests/upload-event-handler.test.ts index 182d32eda3353..80fb459ba171d 100644 --- a/packages/apps/deno-runtime/handlers/tests/upload-event-handler.test.ts +++ b/packages/apps/deno-runtime/handlers/tests/upload-event-handler.test.ts @@ -1,9 +1,9 @@ // deno-lint-ignore-file no-explicit-any import { Buffer } from 'node:buffer'; -import type { App } from '@rocket.chat/apps-engine/definition/App.ts'; -import type { IPreFileUpload } from '@rocket.chat/apps-engine/definition/uploads/IPreFileUpload.ts'; -import type { IUploadDetails } from '@rocket.chat/apps-engine/definition/uploads/IUploadDetails.ts'; +import type { App } from '@rocket.chat/apps-engine/definition/App'; +import type { IPreFileUpload } from '@rocket.chat/apps-engine/definition/uploads/IPreFileUpload'; +import type { IUploadDetails } from '@rocket.chat/apps-engine/definition/uploads/IUploadDetails'; import { assertInstanceOf, assertNotInstanceOf, assertEquals, assertStringIncludes } from 'https://deno.land/std@0.203.0/assert/mod.ts'; import { afterEach, beforeEach, describe, it } from 'https://deno.land/std@0.203.0/testing/bdd.ts'; import { assertSpyCalls, spy } from 'https://deno.land/std@0.203.0/testing/mock.ts'; diff --git a/packages/apps/deno-runtime/handlers/uikit/handler.ts b/packages/apps/deno-runtime/handlers/uikit/handler.ts index 8d352d21927e7..9f45989a03ffb 100644 --- a/packages/apps/deno-runtime/handlers/uikit/handler.ts +++ b/packages/apps/deno-runtime/handlers/uikit/handler.ts @@ -1,4 +1,4 @@ -import type { App } from '@rocket.chat/apps-engine/definition/App.ts'; +import type { App } from '@rocket.chat/apps-engine/definition/App'; import { Defined, JsonRpcError } from 'jsonrpc-lite'; import { require } from '../../lib/require.ts'; diff --git a/packages/apps/deno-runtime/handlers/videoconference-handler.ts b/packages/apps/deno-runtime/handlers/videoconference-handler.ts index 5c82aedd3a63c..b05c967ca5293 100644 --- a/packages/apps/deno-runtime/handlers/videoconference-handler.ts +++ b/packages/apps/deno-runtime/handlers/videoconference-handler.ts @@ -1,4 +1,4 @@ -import type { IVideoConfProvider } from '@rocket.chat/apps-engine/definition/videoConfProviders/IVideoConfProvider.ts'; +import type { IVideoConfProvider } from '@rocket.chat/apps-engine/definition/videoConfProviders/IVideoConfProvider'; import { Defined, JsonRpcError } from 'jsonrpc-lite'; import { AppObjectRegistry } from '../AppObjectRegistry.ts'; diff --git a/packages/apps/deno-runtime/lib/accessors/builders/BlockBuilder.ts b/packages/apps/deno-runtime/lib/accessors/builders/BlockBuilder.ts index de103fe50be02..77b4c3e8e1696 100644 --- a/packages/apps/deno-runtime/lib/accessors/builders/BlockBuilder.ts +++ b/packages/apps/deno-runtime/lib/accessors/builders/BlockBuilder.ts @@ -10,7 +10,7 @@ import type { IImageBlock, IInputBlock, ISectionBlock, -} from '@rocket.chat/apps-engine/definition/uikit/blocks/Blocks.ts'; +} from '@rocket.chat/apps-engine/definition/uikit/blocks/Blocks'; import type { BlockElementType as _BlockElementType, IBlockElement, @@ -23,8 +23,8 @@ import type { IPlainTextInputElement, ISelectElement, IStaticSelectElement, -} from '@rocket.chat/apps-engine/definition/uikit/blocks/Elements.ts'; -import type { ITextObject, TextObjectType as _TextObjectType } from '@rocket.chat/apps-engine/definition/uikit/blocks/Objects.ts'; +} from '@rocket.chat/apps-engine/definition/uikit/blocks/Elements'; +import type { ITextObject, TextObjectType as _TextObjectType } from '@rocket.chat/apps-engine/definition/uikit/blocks/Objects'; import { AppObjectRegistry } from '../../../AppObjectRegistry.ts'; import { require } from '../../../lib/require.ts'; diff --git a/packages/apps/deno-runtime/lib/accessors/builders/DiscussionBuilder.ts b/packages/apps/deno-runtime/lib/accessors/builders/DiscussionBuilder.ts index adbf060182e1d..d927844a3377f 100644 --- a/packages/apps/deno-runtime/lib/accessors/builders/DiscussionBuilder.ts +++ b/packages/apps/deno-runtime/lib/accessors/builders/DiscussionBuilder.ts @@ -1,10 +1,10 @@ -import type { IDiscussionBuilder as _IDiscussionBuilder } from '@rocket.chat/apps-engine/definition/accessors/IDiscussionBuilder.ts'; -import type { IMessage } from '@rocket.chat/apps-engine/definition/messages/IMessage.ts'; -import type { IRoom } from '@rocket.chat/apps-engine/definition/rooms/IRoom.ts'; -import type { IRoomBuilder } from '@rocket.chat/apps-engine/definition/accessors/IRoomBuilder.ts'; +import type { IDiscussionBuilder as _IDiscussionBuilder } from '@rocket.chat/apps-engine/definition/accessors/IDiscussionBuilder'; +import type { IMessage } from '@rocket.chat/apps-engine/definition/messages/IMessage'; +import type { IRoom } from '@rocket.chat/apps-engine/definition/rooms/IRoom'; +import type { IRoomBuilder } from '@rocket.chat/apps-engine/definition/accessors/IRoomBuilder'; -import type { RocketChatAssociationModel as _RocketChatAssociationModel } from '@rocket.chat/apps-engine/definition/metadata/RocketChatAssociations.ts'; -import type { RoomType as _RoomType } from '@rocket.chat/apps-engine/definition/rooms/RoomType.ts'; +import type { RocketChatAssociationModel as _RocketChatAssociationModel } from '@rocket.chat/apps-engine/definition/metadata/RocketChatAssociations'; +import type { RoomType as _RoomType } from '@rocket.chat/apps-engine/definition/rooms/RoomType'; import { RoomBuilder } from './RoomBuilder.ts'; import { require } from '../../../lib/require.ts'; diff --git a/packages/apps/deno-runtime/lib/accessors/builders/LivechatMessageBuilder.ts b/packages/apps/deno-runtime/lib/accessors/builders/LivechatMessageBuilder.ts index b39a418c5aec0..27426179386dd 100644 --- a/packages/apps/deno-runtime/lib/accessors/builders/LivechatMessageBuilder.ts +++ b/packages/apps/deno-runtime/lib/accessors/builders/LivechatMessageBuilder.ts @@ -1,14 +1,14 @@ -import type { RocketChatAssociationModel as _RocketChatAssociationModel } from '@rocket.chat/apps-engine/definition/metadata/RocketChatAssociations.ts'; -import type { RoomType as _RoomType } from '@rocket.chat/apps-engine/definition/rooms/RoomType.ts'; - -import type { ILivechatMessageBuilder } from '@rocket.chat/apps-engine/definition/accessors/ILivechatMessageBuilder.ts'; -import type { IMessage } from '@rocket.chat/apps-engine/definition/messages/IMessage.ts'; -import type { IMessageAttachment } from '@rocket.chat/apps-engine/definition/messages/IMessageAttachment.ts'; -import type { IRoom } from '@rocket.chat/apps-engine/definition/rooms/IRoom.ts'; -import type { IUser } from '@rocket.chat/apps-engine/definition/users/IUser.ts'; -import type { ILivechatMessage as EngineLivechatMessage } from '@rocket.chat/apps-engine/definition/livechat/ILivechatMessage.ts'; -import type { IVisitor } from '@rocket.chat/apps-engine/definition/livechat/IVisitor.ts'; -import type { IMessageBuilder } from '@rocket.chat/apps-engine/definition/accessors/IMessageBuilder.ts'; +import type { RocketChatAssociationModel as _RocketChatAssociationModel } from '@rocket.chat/apps-engine/definition/metadata/RocketChatAssociations'; +import type { RoomType as _RoomType } from '@rocket.chat/apps-engine/definition/rooms/RoomType'; + +import type { ILivechatMessageBuilder } from '@rocket.chat/apps-engine/definition/accessors/ILivechatMessageBuilder'; +import type { IMessage } from '@rocket.chat/apps-engine/definition/messages/IMessage'; +import type { IMessageAttachment } from '@rocket.chat/apps-engine/definition/messages/IMessageAttachment'; +import type { IRoom } from '@rocket.chat/apps-engine/definition/rooms/IRoom'; +import type { IUser } from '@rocket.chat/apps-engine/definition/users/IUser'; +import type { ILivechatMessage as EngineLivechatMessage } from '@rocket.chat/apps-engine/definition/livechat/ILivechatMessage'; +import type { IVisitor } from '@rocket.chat/apps-engine/definition/livechat/IVisitor'; +import type { IMessageBuilder } from '@rocket.chat/apps-engine/definition/accessors/IMessageBuilder'; import { MessageBuilder } from './MessageBuilder.ts'; import { require } from '../../../lib/require.ts'; diff --git a/packages/apps/deno-runtime/lib/accessors/builders/MessageBuilder.ts b/packages/apps/deno-runtime/lib/accessors/builders/MessageBuilder.ts index 032b4ba2552e9..acea8aacc0cc8 100644 --- a/packages/apps/deno-runtime/lib/accessors/builders/MessageBuilder.ts +++ b/packages/apps/deno-runtime/lib/accessors/builders/MessageBuilder.ts @@ -1,12 +1,12 @@ import { LayoutBlock } from '@rocket.chat/ui-kit'; -import type { IMessageBuilder } from '@rocket.chat/apps-engine/definition/accessors/IMessageBuilder.ts'; -import type { RocketChatAssociationModel as _RocketChatAssociationModel } from '@rocket.chat/apps-engine/definition/metadata/RocketChatAssociations.ts'; -import type { IMessage } from '@rocket.chat/apps-engine/definition/messages/IMessage.ts'; -import type { IMessageAttachment } from '@rocket.chat/apps-engine/definition/messages/IMessageAttachment.ts'; -import type { IUser } from '@rocket.chat/apps-engine/definition/users/IUser.ts'; -import type { IRoom } from '@rocket.chat/apps-engine/definition/rooms/IRoom.ts'; -import type { IBlock } from '@rocket.chat/apps-engine/definition/uikit/blocks/Blocks.ts'; +import type { IMessageBuilder } from '@rocket.chat/apps-engine/definition/accessors/IMessageBuilder'; +import type { RocketChatAssociationModel as _RocketChatAssociationModel } from '@rocket.chat/apps-engine/definition/metadata/RocketChatAssociations'; +import type { IMessage } from '@rocket.chat/apps-engine/definition/messages/IMessage'; +import type { IMessageAttachment } from '@rocket.chat/apps-engine/definition/messages/IMessageAttachment'; +import type { IUser } from '@rocket.chat/apps-engine/definition/users/IUser'; +import type { IRoom } from '@rocket.chat/apps-engine/definition/rooms/IRoom'; +import type { IBlock } from '@rocket.chat/apps-engine/definition/uikit/blocks/Blocks'; import { BlockBuilder } from './BlockBuilder.ts'; import { require } from '../../../lib/require.ts'; diff --git a/packages/apps/deno-runtime/lib/accessors/builders/RoomBuilder.ts b/packages/apps/deno-runtime/lib/accessors/builders/RoomBuilder.ts index 208d476d32162..a2912e44913dd 100644 --- a/packages/apps/deno-runtime/lib/accessors/builders/RoomBuilder.ts +++ b/packages/apps/deno-runtime/lib/accessors/builders/RoomBuilder.ts @@ -1,9 +1,9 @@ -import type { IRoomBuilder } from '@rocket.chat/apps-engine/definition/accessors/IRoomBuilder.ts'; -import type { IRoom } from '@rocket.chat/apps-engine/definition/rooms/IRoom.ts'; -import type { IUser } from '@rocket.chat/apps-engine/definition/users/IUser.ts'; +import type { IRoomBuilder } from '@rocket.chat/apps-engine/definition/accessors/IRoomBuilder'; +import type { IRoom } from '@rocket.chat/apps-engine/definition/rooms/IRoom'; +import type { IUser } from '@rocket.chat/apps-engine/definition/users/IUser'; -import type { RoomType } from '@rocket.chat/apps-engine/definition/rooms/RoomType.ts'; -import type { RocketChatAssociationModel as _RocketChatAssociationModel } from '@rocket.chat/apps-engine/definition/metadata/RocketChatAssociations.ts'; +import type { RoomType } from '@rocket.chat/apps-engine/definition/rooms/RoomType'; +import type { RocketChatAssociationModel as _RocketChatAssociationModel } from '@rocket.chat/apps-engine/definition/metadata/RocketChatAssociations'; import { require } from '../../../lib/require.ts'; diff --git a/packages/apps/deno-runtime/lib/accessors/builders/UserBuilder.ts b/packages/apps/deno-runtime/lib/accessors/builders/UserBuilder.ts index caaf9a69d5941..079607b4ecfd0 100644 --- a/packages/apps/deno-runtime/lib/accessors/builders/UserBuilder.ts +++ b/packages/apps/deno-runtime/lib/accessors/builders/UserBuilder.ts @@ -1,8 +1,8 @@ -import type { IUserBuilder } from '@rocket.chat/apps-engine/definition/accessors/IUserBuilder.ts'; -import type { IUser } from '@rocket.chat/apps-engine/definition/users/IUser.ts'; -import type { IUserSettings } from '@rocket.chat/apps-engine/definition/users/IUserSettings.ts'; -import type { IUserEmail } from '@rocket.chat/apps-engine/definition/users/IUserEmail.ts'; -import type { RocketChatAssociationModel as _RocketChatAssociationModel } from '@rocket.chat/apps-engine/definition/metadata/RocketChatAssociations.ts'; +import type { IUserBuilder } from '@rocket.chat/apps-engine/definition/accessors/IUserBuilder'; +import type { IUser } from '@rocket.chat/apps-engine/definition/users/IUser'; +import type { IUserSettings } from '@rocket.chat/apps-engine/definition/users/IUserSettings'; +import type { IUserEmail } from '@rocket.chat/apps-engine/definition/users/IUserEmail'; +import type { RocketChatAssociationModel as _RocketChatAssociationModel } from '@rocket.chat/apps-engine/definition/metadata/RocketChatAssociations'; import { require } from '../../../lib/require.ts'; diff --git a/packages/apps/deno-runtime/lib/accessors/builders/VideoConferenceBuilder.ts b/packages/apps/deno-runtime/lib/accessors/builders/VideoConferenceBuilder.ts index e1bc3f3cf5b24..2ab47745d4b64 100644 --- a/packages/apps/deno-runtime/lib/accessors/builders/VideoConferenceBuilder.ts +++ b/packages/apps/deno-runtime/lib/accessors/builders/VideoConferenceBuilder.ts @@ -1,7 +1,7 @@ -import type { IVideoConferenceBuilder } from '@rocket.chat/apps-engine/definition/accessors/IVideoConferenceBuilder.ts'; -import type { IGroupVideoConference } from '@rocket.chat/apps-engine/definition/videoConferences/IVideoConference.ts'; +import type { IVideoConferenceBuilder } from '@rocket.chat/apps-engine/definition/accessors/IVideoConferenceBuilder'; +import type { IGroupVideoConference } from '@rocket.chat/apps-engine/definition/videoConferences/IVideoConference'; -import type { RocketChatAssociationModel as _RocketChatAssociationModel } from '@rocket.chat/apps-engine/definition/metadata/RocketChatAssociations.ts'; +import type { RocketChatAssociationModel as _RocketChatAssociationModel } from '@rocket.chat/apps-engine/definition/metadata/RocketChatAssociations'; import { require } from '../../../lib/require.ts'; diff --git a/packages/apps/deno-runtime/lib/accessors/extenders/HttpExtender.ts b/packages/apps/deno-runtime/lib/accessors/extenders/HttpExtender.ts index 8342850975017..03a39ff1fedc2 100644 --- a/packages/apps/deno-runtime/lib/accessors/extenders/HttpExtender.ts +++ b/packages/apps/deno-runtime/lib/accessors/extenders/HttpExtender.ts @@ -1,4 +1,4 @@ -import type { IHttpExtend, IHttpPreRequestHandler, IHttpPreResponseHandler } from '@rocket.chat/apps-engine/definition/accessors/IHttp.ts'; +import type { IHttpExtend, IHttpPreRequestHandler, IHttpPreResponseHandler } from '@rocket.chat/apps-engine/definition/accessors/IHttp'; export class HttpExtend implements IHttpExtend { private headers: Map; diff --git a/packages/apps/deno-runtime/lib/accessors/extenders/MessageExtender.ts b/packages/apps/deno-runtime/lib/accessors/extenders/MessageExtender.ts index 1f45137e15d4b..0364202b0f320 100644 --- a/packages/apps/deno-runtime/lib/accessors/extenders/MessageExtender.ts +++ b/packages/apps/deno-runtime/lib/accessors/extenders/MessageExtender.ts @@ -1,7 +1,7 @@ -import type { IMessageExtender } from '@rocket.chat/apps-engine/definition/accessors/IMessageExtender.ts'; -import type { RocketChatAssociationModel as _RocketChatAssociationModel } from '@rocket.chat/apps-engine/definition/metadata/RocketChatAssociations.ts'; -import type { IMessage } from '@rocket.chat/apps-engine/definition/messages/IMessage.ts'; -import type { IMessageAttachment } from '@rocket.chat/apps-engine/definition/messages/IMessageAttachment.ts'; +import type { IMessageExtender } from '@rocket.chat/apps-engine/definition/accessors/IMessageExtender'; +import type { RocketChatAssociationModel as _RocketChatAssociationModel } from '@rocket.chat/apps-engine/definition/metadata/RocketChatAssociations'; +import type { IMessage } from '@rocket.chat/apps-engine/definition/messages/IMessage'; +import type { IMessageAttachment } from '@rocket.chat/apps-engine/definition/messages/IMessageAttachment'; import { require } from '../../../lib/require.ts'; diff --git a/packages/apps/deno-runtime/lib/accessors/extenders/RoomExtender.ts b/packages/apps/deno-runtime/lib/accessors/extenders/RoomExtender.ts index a138e08d2d28e..ae3ebeaf34f9e 100644 --- a/packages/apps/deno-runtime/lib/accessors/extenders/RoomExtender.ts +++ b/packages/apps/deno-runtime/lib/accessors/extenders/RoomExtender.ts @@ -1,7 +1,7 @@ -import type { IRoomExtender } from '@rocket.chat/apps-engine/definition/accessors/IRoomExtender.ts'; -import type { RocketChatAssociationModel as _RocketChatAssociationModel } from '@rocket.chat/apps-engine/definition/metadata/RocketChatAssociations.ts'; -import type { IRoom } from '@rocket.chat/apps-engine/definition/rooms/IRoom.ts'; -import type { IUser } from '@rocket.chat/apps-engine/definition/users/IUser.ts'; +import type { IRoomExtender } from '@rocket.chat/apps-engine/definition/accessors/IRoomExtender'; +import type { RocketChatAssociationModel as _RocketChatAssociationModel } from '@rocket.chat/apps-engine/definition/metadata/RocketChatAssociations'; +import type { IRoom } from '@rocket.chat/apps-engine/definition/rooms/IRoom'; +import type { IUser } from '@rocket.chat/apps-engine/definition/users/IUser'; import { require } from '../../../lib/require.ts'; diff --git a/packages/apps/deno-runtime/lib/accessors/extenders/VideoConferenceExtend.ts b/packages/apps/deno-runtime/lib/accessors/extenders/VideoConferenceExtend.ts index c4b154f46cb32..de4e4a0121af2 100644 --- a/packages/apps/deno-runtime/lib/accessors/extenders/VideoConferenceExtend.ts +++ b/packages/apps/deno-runtime/lib/accessors/extenders/VideoConferenceExtend.ts @@ -1,7 +1,7 @@ -import type { IVideoConferenceExtender } from '@rocket.chat/apps-engine/definition/accessors/IVideoConferenceExtend.ts'; -import type { VideoConference, VideoConferenceMember } from '@rocket.chat/apps-engine/definition/videoConferences/IVideoConference.ts'; -import type { IVideoConferenceUser } from '@rocket.chat/apps-engine/definition/videoConferences/IVideoConferenceUser.ts'; -import type { RocketChatAssociationModel as _RocketChatAssociationModel } from '@rocket.chat/apps-engine/definition/metadata/RocketChatAssociations.ts'; +import type { IVideoConferenceExtender } from '@rocket.chat/apps-engine/definition/accessors/IVideoConferenceExtend'; +import type { VideoConference, VideoConferenceMember } from '@rocket.chat/apps-engine/definition/videoConferences/IVideoConference'; +import type { IVideoConferenceUser } from '@rocket.chat/apps-engine/definition/videoConferences/IVideoConferenceUser'; +import type { RocketChatAssociationModel as _RocketChatAssociationModel } from '@rocket.chat/apps-engine/definition/metadata/RocketChatAssociations'; import { require } from '../../../lib/require.ts'; diff --git a/packages/apps/deno-runtime/lib/accessors/http.ts b/packages/apps/deno-runtime/lib/accessors/http.ts index 41f1025150fdc..76a2a3ac9fc00 100644 --- a/packages/apps/deno-runtime/lib/accessors/http.ts +++ b/packages/apps/deno-runtime/lib/accessors/http.ts @@ -1,6 +1,6 @@ -import type { IHttp, IHttpExtend, IHttpRequest, IHttpResponse } from '@rocket.chat/apps-engine/definition/accessors/IHttp.ts'; -import type { IPersistence } from '@rocket.chat/apps-engine/definition/accessors/IPersistence.ts'; -import type { IRead } from '@rocket.chat/apps-engine/definition/accessors/IRead.ts'; +import type { IHttp, IHttpExtend, IHttpRequest, IHttpResponse } from '@rocket.chat/apps-engine/definition/accessors/IHttp'; +import type { IPersistence } from '@rocket.chat/apps-engine/definition/accessors/IPersistence'; +import type { IRead } from '@rocket.chat/apps-engine/definition/accessors/IRead'; import * as Messenger from '../messenger.ts'; import { AppObjectRegistry } from '../../AppObjectRegistry.ts'; diff --git a/packages/apps/deno-runtime/lib/accessors/mod.ts b/packages/apps/deno-runtime/lib/accessors/mod.ts index fc2fb6a3f6669..cfc6bcf629316 100644 --- a/packages/apps/deno-runtime/lib/accessors/mod.ts +++ b/packages/apps/deno-runtime/lib/accessors/mod.ts @@ -1,22 +1,22 @@ -import type { IAppAccessors } from '@rocket.chat/apps-engine/definition/accessors/IAppAccessors.ts'; -import type { IApiEndpointMetadata } from '@rocket.chat/apps-engine/definition/api/IApiEndpointMetadata.ts'; -import type { IEnvironmentWrite } from '@rocket.chat/apps-engine/definition/accessors/IEnvironmentWrite.ts'; -import type { IEnvironmentRead } from '@rocket.chat/apps-engine/definition/accessors/IEnvironmentRead.ts'; -import type { IConfigurationModify } from '@rocket.chat/apps-engine/definition/accessors/IConfigurationModify.ts'; -import type { IRead } from '@rocket.chat/apps-engine/definition/accessors/IRead.ts'; -import type { IModify } from '@rocket.chat/apps-engine/definition/accessors/IModify.ts'; -import type { INotifier } from '@rocket.chat/apps-engine/definition/accessors/INotifier.ts'; -import type { IPersistence } from '@rocket.chat/apps-engine/definition/accessors/IPersistence.ts'; -import type { IHttp, IHttpExtend } from '@rocket.chat/apps-engine/definition/accessors/IHttp.ts'; -import type { IConfigurationExtend } from '@rocket.chat/apps-engine/definition/accessors/IConfigurationExtend.ts'; -import type { ISlashCommand } from '@rocket.chat/apps-engine/definition/slashcommands/ISlashCommand.ts'; -import type { IProcessor } from '@rocket.chat/apps-engine/definition/scheduler/IProcessor.ts'; -import type { IApi } from '@rocket.chat/apps-engine/definition/api/IApi.ts'; -import type { IVideoConfProvider } from '@rocket.chat/apps-engine/definition/videoConfProviders/IVideoConfProvider.ts'; +import type { IAppAccessors } from '@rocket.chat/apps-engine/definition/accessors/IAppAccessors'; +import type { IApiEndpointMetadata } from '@rocket.chat/apps-engine/definition/api/IApiEndpointMetadata'; +import type { IEnvironmentWrite } from '@rocket.chat/apps-engine/definition/accessors/IEnvironmentWrite'; +import type { IEnvironmentRead } from '@rocket.chat/apps-engine/definition/accessors/IEnvironmentRead'; +import type { IConfigurationModify } from '@rocket.chat/apps-engine/definition/accessors/IConfigurationModify'; +import type { IRead } from '@rocket.chat/apps-engine/definition/accessors/IRead'; +import type { IModify } from '@rocket.chat/apps-engine/definition/accessors/IModify'; +import type { INotifier } from '@rocket.chat/apps-engine/definition/accessors/INotifier'; +import type { IPersistence } from '@rocket.chat/apps-engine/definition/accessors/IPersistence'; +import type { IHttp, IHttpExtend } from '@rocket.chat/apps-engine/definition/accessors/IHttp'; +import type { IConfigurationExtend } from '@rocket.chat/apps-engine/definition/accessors/IConfigurationExtend'; +import type { ISlashCommand } from '@rocket.chat/apps-engine/definition/slashcommands/ISlashCommand'; +import type { IProcessor } from '@rocket.chat/apps-engine/definition/scheduler/IProcessor'; +import type { IApi } from '@rocket.chat/apps-engine/definition/api/IApi'; +import type { IVideoConfProvider } from '@rocket.chat/apps-engine/definition/videoConfProviders/IVideoConfProvider'; import type { IOutboundPhoneMessageProvider, IOutboundEmailMessageProvider, -} from '@rocket.chat/apps-engine/definition/outboundCommunication/IOutboundCommsProvider.ts'; +} from '@rocket.chat/apps-engine/definition/outboundCommunication/IOutboundCommsProvider'; import { Http } from './http.ts'; import { HttpExtend } from './extenders/HttpExtender.ts'; diff --git a/packages/apps/deno-runtime/lib/accessors/modify/ModifyCreator.ts b/packages/apps/deno-runtime/lib/accessors/modify/ModifyCreator.ts index d30e22c1be182..fea76bacddc4a 100644 --- a/packages/apps/deno-runtime/lib/accessors/modify/ModifyCreator.ts +++ b/packages/apps/deno-runtime/lib/accessors/modify/ModifyCreator.ts @@ -1,23 +1,24 @@ -import type { IModifyCreator } from '@rocket.chat/apps-engine/definition/accessors/IModifyCreator.ts'; -import type { IUploadCreator } from '@rocket.chat/apps-engine/definition/accessors/IUploadCreator.ts'; -import type { IEmailCreator } from '@rocket.chat/apps-engine/definition/accessors/IEmailCreator.ts'; -import type { IContactCreator } from '@rocket.chat/apps-engine/definition/accessors/IContactCreator.ts'; -import type { ILivechatCreator } from '@rocket.chat/apps-engine/definition/accessors/ILivechatCreator.ts'; -import type { IMessage } from '@rocket.chat/apps-engine/definition/messages/IMessage.ts'; -import type { IRoom } from '@rocket.chat/apps-engine/definition/rooms/IRoom.ts'; -import type { IBotUser } from '@rocket.chat/apps-engine/definition/users/IBotUser.ts'; -import type { UserType as _UserType } from '@rocket.chat/apps-engine/definition/users/UserType.ts'; -import type { RocketChatAssociationModel as _RocketChatAssociationModel } from '@rocket.chat/apps-engine/definition/metadata/RocketChatAssociations.ts'; -import type { IMessageBuilder } from '@rocket.chat/apps-engine/definition/accessors/IMessageBuilder.ts'; -import type { IRoomBuilder } from '@rocket.chat/apps-engine/definition/accessors/IRoomBuilder.ts'; -import type { IUserBuilder } from '@rocket.chat/apps-engine/definition/accessors/IUserBuilder.ts'; -import type { IVideoConferenceBuilder } from '@rocket.chat/apps-engine/definition/accessors/IVideoConferenceBuilder.ts'; -import type { RoomType as _RoomType } from '@rocket.chat/apps-engine/definition/rooms/RoomType.ts'; -import type { ILivechatMessageBuilder } from '@rocket.chat/apps-engine/definition/accessors/ILivechatMessageBuilder.ts'; -import type { UIHelper as _UIHelper } from '@rocket.chat/apps-engine/server/misc/UIHelper.ts'; +import { randomBytes } from 'node:crypto'; + +import { UIHelper } from '@rocket.chat/apps/dist/server/misc/UIHelper'; +import type { IModifyCreator } from '@rocket.chat/apps-engine/definition/accessors/IModifyCreator'; +import type { IUploadCreator } from '@rocket.chat/apps-engine/definition/accessors/IUploadCreator'; +import type { IEmailCreator } from '@rocket.chat/apps-engine/definition/accessors/IEmailCreator'; +import type { IContactCreator } from '@rocket.chat/apps-engine/definition/accessors/IContactCreator'; +import type { ILivechatCreator } from '@rocket.chat/apps-engine/definition/accessors/ILivechatCreator'; +import type { IMessage } from '@rocket.chat/apps-engine/definition/messages/IMessage'; +import type { IRoom } from '@rocket.chat/apps-engine/definition/rooms/IRoom'; +import type { IBotUser } from '@rocket.chat/apps-engine/definition/users/IBotUser'; +import type { UserType as _UserType } from '@rocket.chat/apps-engine/definition/users/UserType'; +import type { RocketChatAssociationModel as _RocketChatAssociationModel } from '@rocket.chat/apps-engine/definition/metadata/RocketChatAssociations'; +import type { IMessageBuilder } from '@rocket.chat/apps-engine/definition/accessors/IMessageBuilder'; +import type { IRoomBuilder } from '@rocket.chat/apps-engine/definition/accessors/IRoomBuilder'; +import type { IUserBuilder } from '@rocket.chat/apps-engine/definition/accessors/IUserBuilder'; +import type { IVideoConferenceBuilder } from '@rocket.chat/apps-engine/definition/accessors/IVideoConferenceBuilder'; +import type { RoomType as _RoomType } from '@rocket.chat/apps-engine/definition/rooms/RoomType'; +import type { ILivechatMessageBuilder } from '@rocket.chat/apps-engine/definition/accessors/ILivechatMessageBuilder'; import * as Messenger from '../../messenger.ts'; -import { randomBytes } from 'node:crypto'; import { BlockBuilder } from '../builders/BlockBuilder.ts'; import { MessageBuilder } from '../builders/MessageBuilder.ts'; @@ -30,7 +31,6 @@ import { AppObjectRegistry } from '../../../AppObjectRegistry.ts'; import { require } from '../../../lib/require.ts'; import { formatErrorResponse } from '../formatResponseErrorHandler.ts'; -const { UIHelper } = require('@rocket.chat/apps-engine/server/misc/UIHelper.js') as { UIHelper: typeof _UIHelper }; const { RoomType } = require('@rocket.chat/apps-engine/definition/rooms/RoomType.js') as { RoomType: typeof _RoomType }; const { UserType } = require('@rocket.chat/apps-engine/definition/users/UserType.js') as { UserType: typeof _UserType }; const { RocketChatAssociationModel } = require('@rocket.chat/apps-engine/definition/metadata/RocketChatAssociations.js') as { @@ -107,7 +107,7 @@ export class ModifyCreator implements IModifyCreator { throw formatErrorResponse(err); }), }, - ); + ) as IEmailCreator; } getContactCreator(): IContactCreator { @@ -128,7 +128,7 @@ export class ModifyCreator implements IModifyCreator { throw formatErrorResponse(err); }), }, - ); + ) as IContactCreator; } getBlockBuilder() { diff --git a/packages/apps/deno-runtime/lib/accessors/modify/ModifyExtender.ts b/packages/apps/deno-runtime/lib/accessors/modify/ModifyExtender.ts index 5f8e0c53ec04a..01bbca2ab0ee0 100644 --- a/packages/apps/deno-runtime/lib/accessors/modify/ModifyExtender.ts +++ b/packages/apps/deno-runtime/lib/accessors/modify/ModifyExtender.ts @@ -1,12 +1,12 @@ -import type { IModifyExtender } from '@rocket.chat/apps-engine/definition/accessors/IModifyExtender.ts'; -import type { IMessage } from '@rocket.chat/apps-engine/definition/messages/IMessage.ts'; -import type { IMessageExtender } from '@rocket.chat/apps-engine/definition/accessors/IMessageExtender.ts'; -import type { IRoomExtender } from '@rocket.chat/apps-engine/definition/accessors/IRoomExtender.ts'; -import type { IVideoConferenceExtender } from '@rocket.chat/apps-engine/definition/accessors/IVideoConferenceExtend.ts'; -import type { IUser } from '@rocket.chat/apps-engine/definition/users/IUser.ts'; -import type { VideoConference } from '@rocket.chat/apps-engine/definition/videoConferences/IVideoConference.ts'; -import type { IRoom } from '@rocket.chat/apps-engine/definition/rooms/IRoom.ts'; -import type { RocketChatAssociationModel as _RocketChatAssociationModel } from '@rocket.chat/apps-engine/definition/metadata/RocketChatAssociations.ts'; +import type { IModifyExtender } from '@rocket.chat/apps-engine/definition/accessors/IModifyExtender'; +import type { IMessage } from '@rocket.chat/apps-engine/definition/messages/IMessage'; +import type { IMessageExtender } from '@rocket.chat/apps-engine/definition/accessors/IMessageExtender'; +import type { IRoomExtender } from '@rocket.chat/apps-engine/definition/accessors/IRoomExtender'; +import type { IVideoConferenceExtender } from '@rocket.chat/apps-engine/definition/accessors/IVideoConferenceExtend'; +import type { IUser } from '@rocket.chat/apps-engine/definition/users/IUser'; +import type { VideoConference } from '@rocket.chat/apps-engine/definition/videoConferences/IVideoConference'; +import type { IRoom } from '@rocket.chat/apps-engine/definition/rooms/IRoom'; +import type { RocketChatAssociationModel as _RocketChatAssociationModel } from '@rocket.chat/apps-engine/definition/metadata/RocketChatAssociations'; import * as Messenger from '../../messenger.ts'; import { AppObjectRegistry } from '../../../AppObjectRegistry.ts'; diff --git a/packages/apps/deno-runtime/lib/accessors/modify/ModifyUpdater.ts b/packages/apps/deno-runtime/lib/accessors/modify/ModifyUpdater.ts index 301437627de18..06bcb07f8765e 100644 --- a/packages/apps/deno-runtime/lib/accessors/modify/ModifyUpdater.ts +++ b/packages/apps/deno-runtime/lib/accessors/modify/ModifyUpdater.ts @@ -1,16 +1,16 @@ -import type { IModifyUpdater } from '@rocket.chat/apps-engine/definition/accessors/IModifyUpdater.ts'; -import type { ILivechatUpdater } from '@rocket.chat/apps-engine/definition/accessors/ILivechatUpdater.ts'; -import type { IUserUpdater } from '@rocket.chat/apps-engine/definition/accessors/IUserUpdater.ts'; -import type { IMessageUpdater } from '@rocket.chat/apps-engine/definition/accessors/IMessageUpdater.ts'; -import type { IMessageBuilder } from '@rocket.chat/apps-engine/definition/accessors/IMessageBuilder.ts'; -import type { IRoomBuilder } from '@rocket.chat/apps-engine/definition/accessors/IRoomBuilder.ts'; -import type { IUser } from '@rocket.chat/apps-engine/definition/users/IUser.ts'; -import type { IMessage } from '@rocket.chat/apps-engine/definition/messages/IMessage.ts'; -import type { IRoom } from '@rocket.chat/apps-engine/definition/rooms/IRoom.ts'; - -import type { UIHelper as _UIHelper } from '@rocket.chat/apps-engine/server/misc/UIHelper.ts'; -import type { RoomType as _RoomType } from '@rocket.chat/apps-engine/definition/rooms/RoomType.ts'; -import type { RocketChatAssociationModel as _RocketChatAssociationModel } from '@rocket.chat/apps-engine/definition/metadata/RocketChatAssociations.ts'; +import { UIHelper } from '@rocket.chat/apps/dist/server/misc/UIHelper'; +import type { IModifyUpdater } from '@rocket.chat/apps-engine/definition/accessors/IModifyUpdater'; +import type { ILivechatUpdater } from '@rocket.chat/apps-engine/definition/accessors/ILivechatUpdater'; +import type { IUserUpdater } from '@rocket.chat/apps-engine/definition/accessors/IUserUpdater'; +import type { IMessageUpdater } from '@rocket.chat/apps-engine/definition/accessors/IMessageUpdater'; +import type { IMessageBuilder } from '@rocket.chat/apps-engine/definition/accessors/IMessageBuilder'; +import type { IRoomBuilder } from '@rocket.chat/apps-engine/definition/accessors/IRoomBuilder'; +import type { IUser } from '@rocket.chat/apps-engine/definition/users/IUser'; +import type { IMessage } from '@rocket.chat/apps-engine/definition/messages/IMessage'; +import type { IRoom } from '@rocket.chat/apps-engine/definition/rooms/IRoom'; + +import type { RoomType as _RoomType } from '@rocket.chat/apps-engine/definition/rooms/RoomType'; +import type { RocketChatAssociationModel as _RocketChatAssociationModel } from '@rocket.chat/apps-engine/definition/metadata/RocketChatAssociations'; import * as Messenger from '../../messenger.ts'; @@ -21,7 +21,6 @@ import { AppObjectRegistry } from '../../../AppObjectRegistry.ts'; import { require } from '../../../lib/require.ts'; import { formatErrorResponse } from '../formatResponseErrorHandler.ts'; -const { UIHelper } = require('@rocket.chat/apps-engine/server/misc/UIHelper.js') as { UIHelper: typeof _UIHelper }; const { RoomType } = require('@rocket.chat/apps-engine/definition/rooms/RoomType.js') as { RoomType: typeof _RoomType }; const { RocketChatAssociationModel } = require('@rocket.chat/apps-engine/definition/metadata/RocketChatAssociations.js') as { RocketChatAssociationModel: typeof _RocketChatAssociationModel; diff --git a/packages/apps/deno-runtime/lib/accessors/notifier.ts b/packages/apps/deno-runtime/lib/accessors/notifier.ts index 1a85cc12b579f..3a6ac012a2797 100644 --- a/packages/apps/deno-runtime/lib/accessors/notifier.ts +++ b/packages/apps/deno-runtime/lib/accessors/notifier.ts @@ -1,6 +1,6 @@ import type { IMessageBuilder, INotifier } from '@rocket.chat/apps-engine/definition/accessors'; -import type { ITypingOptions } from '@rocket.chat/apps-engine/definition/accessors/INotifier.ts'; -import type { _TypingScope } from '@rocket.chat/apps-engine/definition/accessors/INotifier.ts'; +import type { ITypingOptions } from '@rocket.chat/apps-engine/definition/accessors/INotifier'; +import type { _TypingScope } from '@rocket.chat/apps-engine/definition/accessors/INotifier'; import type { IMessage } from '@rocket.chat/apps-engine/definition/messages'; import type { IRoom } from '@rocket.chat/apps-engine/definition/rooms'; import type { IUser } from '@rocket.chat/apps-engine/definition/users'; diff --git a/packages/apps/deno-runtime/lib/codec.ts b/packages/apps/deno-runtime/lib/codec.ts index 95bbfa1a2aa26..a1da020799982 100644 --- a/packages/apps/deno-runtime/lib/codec.ts +++ b/packages/apps/deno-runtime/lib/codec.ts @@ -1,7 +1,7 @@ import { Buffer } from 'node:buffer'; import { Decoder, Encoder, ExtensionCodec } from '@msgpack/msgpack'; -import type { App as _App } from '@rocket.chat/apps-engine/definition/App.ts'; +import type { App as _App } from '@rocket.chat/apps-engine/definition/App'; import { require } from './require.ts'; const { App } = require('@rocket.chat/apps-engine/definition/App.js') as { diff --git a/packages/apps/deno-runtime/lib/room.ts b/packages/apps/deno-runtime/lib/room.ts index 282ded4a90457..437f091c3cbf1 100644 --- a/packages/apps/deno-runtime/lib/room.ts +++ b/packages/apps/deno-runtime/lib/room.ts @@ -1,7 +1,15 @@ -import type { IRoom } from '@rocket.chat/apps-engine/definition/rooms/IRoom.ts'; -import type { RoomType } from '@rocket.chat/apps-engine/definition/rooms/RoomType.ts'; -import type { IUser } from '@rocket.chat/apps-engine/definition/users/IUser.ts'; -import type { AppManager } from '@rocket.chat/apps-engine/server/AppManager.ts'; +import type { IRoom } from '@rocket.chat/apps-engine/definition/rooms/IRoom'; +import type { RoomType } from '@rocket.chat/apps-engine/definition/rooms/RoomType'; +import type { IUser } from '@rocket.chat/apps-engine/definition/users/IUser'; + +/** Minimal interface covering the only AppManager capability used by Room */ +interface IRoomManager { + getBridges(): { + getInternalBridge(): { + doGetUsernamesOfRoomById(id: string): Promise>; + }; + }; +} const PrivateManager = Symbol('RoomPrivateManager'); @@ -36,12 +44,14 @@ export class Room { private _USERNAMES: Promise> | undefined; - private [PrivateManager]: AppManager | undefined; + private [PrivateManager]: IRoomManager | undefined; /** * @deprecated */ public get usernames(): Promise> { + if (!this.id) return Promise.resolve([]); + if (!this._USERNAMES) { this._USERNAMES = this[PrivateManager]?.getBridges().getInternalBridge().doGetUsernamesOfRoomById(this.id); } @@ -51,7 +61,7 @@ export class Room { public set usernames(usernames) {} - public constructor(room: IRoom, manager: AppManager) { + public constructor(room: IRoom, manager: IRoomManager) { Object.assign(this, room); Object.defineProperty(this, PrivateManager, { diff --git a/packages/apps/deno-runtime/lib/roomFactory.ts b/packages/apps/deno-runtime/lib/roomFactory.ts index e0c2b9f1c4c80..5f7f71a5e7852 100644 --- a/packages/apps/deno-runtime/lib/roomFactory.ts +++ b/packages/apps/deno-runtime/lib/roomFactory.ts @@ -1,9 +1,9 @@ -import type { IRoom } from '@rocket.chat/apps-engine/definition/rooms/IRoom.ts'; -import type { AppManager } from '@rocket.chat/apps-engine/server/AppManager.ts'; +import type { AppManager } from '@rocket.chat/apps/dist/server/AppManager'; +import type { IRoom } from '@rocket.chat/apps-engine/definition/rooms/IRoom'; import { AppAccessors } from './accessors/mod.ts'; -import { Room } from './room.ts'; import { formatErrorResponse } from './accessors/formatResponseErrorHandler.ts'; +import { Room } from './room.ts'; const getMockAppManager = (senderFn: AppAccessors['senderFn']) => ({ getBridges: () => ({ diff --git a/packages/apps/deno-runtime/lib/wrapAppForRequest.ts b/packages/apps/deno-runtime/lib/wrapAppForRequest.ts index e9643c2c0274a..40bc49eca744c 100644 --- a/packages/apps/deno-runtime/lib/wrapAppForRequest.ts +++ b/packages/apps/deno-runtime/lib/wrapAppForRequest.ts @@ -1,4 +1,4 @@ -import type { App } from '@rocket.chat/apps-engine/definition/App.ts'; +import type { App } from '@rocket.chat/apps-engine/definition/App'; import { RequestContext } from './requestContext.ts'; import { isApp, isRecord } from '../handlers/lib/assertions.ts'; diff --git a/packages/apps/src/server/accessors/ExternalComponentsExtend.ts b/packages/apps/src/server/accessors/ExternalComponentsExtend.ts index 41397cb817379..8acfdff1d3317 100644 --- a/packages/apps/src/server/accessors/ExternalComponentsExtend.ts +++ b/packages/apps/src/server/accessors/ExternalComponentsExtend.ts @@ -9,7 +9,6 @@ export class ExternalComponentsExtend implements IExternalComponentsExtend { private readonly appId: string, ) {} - // eslint-disable-next-line @typescript-eslint/naming-convention public async register(externalComponent: IExternalComponent): Promise { return Promise.resolve(this.manager.addExternalComponent(this.appId, externalComponent)); } diff --git a/packages/apps/src/server/runtime/deno/AppsEngineDenoRuntime.ts b/packages/apps/src/server/runtime/deno/AppsEngineDenoRuntime.ts index 28cb60027da15..82822b0a296d3 100644 --- a/packages/apps/src/server/runtime/deno/AppsEngineDenoRuntime.ts +++ b/packages/apps/src/server/runtime/deno/AppsEngineDenoRuntime.ts @@ -20,6 +20,7 @@ import { AppConsole, type ILoggerStorageEntry } from '../../logging'; import type { AppAccessorManager, AppApiManager } from '../../managers'; import type { AppLogStorage, IAppStorageItem } from '../../storage'; import type { IRuntimeController } from '../IRuntimeController'; +import type { DenoConfigurationFileSchema } from './typings'; const baseDebug = debugFactory('appsEngine:runtime:deno'); @@ -58,7 +59,7 @@ const COMMAND_PONG = '_zPONG'; export const JSONRPC_METHOD_NOT_FOUND = -32601; -export function getRuntimeTimeout() { +function getRuntimeTimeout() { const defaultTimeout = 30000; const envValue = isFinite(process.env.APPS_ENGINE_RUNTIME_TIMEOUT as any) ? Number(process.env.APPS_ENGINE_RUNTIME_TIMEOUT) @@ -72,18 +73,49 @@ export function getRuntimeTimeout() { return envValue; } -export function isValidOrigin(accessor: string): accessor is (typeof ALLOWED_ACCESSOR_METHODS)[number] { +function isValidOrigin(accessor: string): accessor is (typeof ALLOWED_ACCESSOR_METHODS)[number] { return ALLOWED_ACCESSOR_METHODS.includes(accessor as any); } -export function getDenoConfigPath(): string { +function getDenoConfigPath(): string { + return require.resolve('../../../../deno-runtime/deno.jsonc'); +} + +/** + * Resolves the absolute path to @rocket.chat/apps-engine's src/ directory. + * Uses require.resolve so it works regardless of the runtime environment + * (monorepo dev, Meteor bundle, standalone node_modules). + */ +function getAppsEngineDir(): string { + return path.dirname(require.resolve('@rocket.chat/apps-engine/package.json')); +} + +/** + * Generates a runtime deno.jsonc at `/deno_runtime.jsonc` by reading + * the static config and injecting the resolved absolute path for + * `@rocket.chat/apps-engine/`. This makes deno-runtime location-independent: + * the path is always correct regardless of where this package is installed. + * + * Returns the path to the generated config file. + */ +function generateEphemeralDenoConfig(targetPath: string, denoConfigPath: string, appsEnginePath: string): void { + let staticConfig: DenoConfigurationFileSchema; + try { - // This path is relative to the compiled version of the Apps-Engine source - return require.resolve('../../../deno-runtime/deno.jsonc'); + staticConfig = JSON.parse(fs.readFileSync(denoConfigPath, 'utf8')); } catch { - // This path is relative to the original Apps-Engine files - used during tests - return require.resolve('../../../../deno-runtime/deno.jsonc'); + throw new Error(`Failed to read the static Deno config at "${denoConfigPath}"`); } + + const runtimeConfig = { + ...staticConfig, + imports: { + ...staticConfig.imports, + '@rocket.chat/apps-engine/': `${appsEnginePath}/`, + }, + }; + + fs.writeFileSync(targetPath, JSON.stringify(runtimeConfig, null, '\t')); } type AbortFunction = (reason?: any) => void; @@ -118,10 +150,20 @@ export class DenoRuntimeSubprocessController extends EventEmitter implements IRu private readonly tempFilePath: string; + private readonly denoBin = 'deno'; + private readonly denoRuntimePath: string; private readonly denoConfigPath: string; + private readonly denoEphemeralConfigPath: string; + + private readonly denoDir: string; + + private readonly appsEnginePath: string; + + private readonly packagePath: string; + constructor( manager: AppManager, // We need to keep the appSource around in case the Deno process needs to be restarted @@ -131,8 +173,14 @@ export class DenoRuntimeSubprocessController extends EventEmitter implements IRu super(); this.tempFilePath = manager.getTempFilePath(); - this.denoRuntimePath = path.join(this.tempFilePath, 'deno-runtime', 'main.ts'); this.denoConfigPath = getDenoConfigPath(); + this.appsEnginePath = getAppsEngineDir(); + + this.packagePath = path.join(path.dirname(this.denoConfigPath), '..'); + this.denoDir = process.env.DENO_DIR ?? path.join(this.packagePath, '.deno-cache'); + + this.denoRuntimePath = path.join(this.tempFilePath, 'deno-runtime', 'main.ts'); + this.denoEphemeralConfigPath = this.denoConfigPath.replace('.jsonc', '.runtime.jsonc'); /** * Deno 2.x refuses to run scripts inside the node_modules, so we create a symlink to the deno runtime files in the temp directory @@ -146,6 +194,9 @@ export class DenoRuntimeSubprocessController extends EventEmitter implements IRu } } + // Generate a runtime config with the resolved absolute path for @rocket.chat/apps-engine/ + generateEphemeralDenoConfig(this.denoEphemeralConfigPath, this.denoConfigPath, this.appsEnginePath); + this.debug = baseDebug.extend(appPackage.info.id); this.messenger = new ProcessMessenger(); this.livenessManager = new LivenessManager({ @@ -164,25 +215,15 @@ export class DenoRuntimeSubprocessController extends EventEmitter implements IRu public spawnProcess(): void { try { - const denoExePath = 'deno'; - - const denoWrapperPath = this.denoRuntimePath; - // During development, the appsEngineDir is enough to run the deno process - const appsEngineDir = path.dirname(path.join(this.denoConfigPath, '..')); - const DENO_DIR = process.env.DENO_DIR ?? path.join(appsEngineDir, '.deno-cache'); - // When running in production, we're likely inside a node_modules which the Deno - // process must be able to read in order to include files that use NPM packages - const parentNodeModulesDir = path.dirname(path.join(appsEngineDir, '..')); - - const allowedDirs = [appsEngineDir, parentNodeModulesDir, this.tempFilePath]; + const allowedDirs = [this.tempFilePath, this.denoDir, this.packagePath, this.appsEnginePath]; const options = [ 'run', '--cached-only', - `--config=${this.denoConfigPath}`, + `--config=${this.denoEphemeralConfigPath}`, `--allow-read=${allowedDirs.join(',')}`, `--allow-env=${ALLOWED_ENVIRONMENT_VARIABLES.join(',')}`, - denoWrapperPath, + this.denoRuntimePath, '--subprocess', this.appPackage.info.id, '--spawnId', @@ -200,12 +241,12 @@ export class DenoRuntimeSubprocessController extends EventEmitter implements IRu // We need to pass the PATH, otherwise the shell won't find the deno executable // But the runtime itself won't have access to the env var because of the parameters PATH: process.env.PATH, - DENO_DIR, + DENO_DIR: this.denoDir, }, }; // SECURITY: We control the command, the arguments and the script that will be executed. - this.deno = child_process.spawn(denoExePath, options, environment); + this.deno = child_process.spawn(this.denoBin, options, environment); this.messenger.setReceiver(this.deno); this.livenessManager.attach(this.deno); diff --git a/packages/apps/src/server/runtime/deno/typings.ts b/packages/apps/src/server/runtime/deno/typings.ts new file mode 100644 index 0000000000000..47aeb1cd1caba --- /dev/null +++ b/packages/apps/src/server/runtime/deno/typings.ts @@ -0,0 +1,24 @@ +export type DenoConfigurationFileSchema = { + compilerOptions?: Record> | Record>; + importMap?: string; + imports?: Record; + scopes?: Record>; + exclude?: string[]; + lint?: Record> | Record>; + fmt?: Record> | Record>; + minimumDependencyAge?: any; + nodeModulesDir?: any; + vendor?: boolean; + tasks?: Record; + test?: Record> | Record>; + publish?: any; + bench?: Record> | Record>; + lock?: string | boolean | { path: string; frozen?: boolean }; + unstable?: string[]; + name?: string; + version?: string; + exports?: string | Record; + permissions?: Record; + patch?: string[]; + links?: string[]; +};