From 40455dd3f2ed662c6aa7b602d983b6da4d7b66b7 Mon Sep 17 00:00:00 2001 From: Joel Carter Date: Thu, 8 Aug 2024 06:15:24 -0500 Subject: [PATCH] Convert all imports to ts --- src/bin/docker-build.ts | 4 ++-- src/bin/generate-dotenv.ts | 2 +- src/bin/start-meta.ts | 2 +- .../metaServer/contentHandlers/debug/configureDebug.ts | 2 +- .../dynamicShare/dynamicShareHandler.ts | 4 ++-- .../dynamicShare/lib/image/spec/getImageMeta.spec.ts | 2 +- .../dynamicShare/spec/dynamicShare.spec.ts | 2 +- .../liveShare/lib/image/ensureImageExists.ts | 10 +++++----- .../liveShare/lib/image/generateImage.ts | 6 +++--- .../liveShare/lib/image/getImageMeta.ts | 4 ++-- .../liveShare/lib/image/getPreviewUrlFromPage.ts | 2 +- .../liveShare/lib/image/pageImageExists.ts | 4 ++-- .../lib/image/spec/ensureImageExists.perf.spec.ts | 4 ++-- .../liveShare/lib/image/spec/getImageMeta.spec.ts | 2 +- .../useIndexAndDeferredPreviewImage.ts | 4 ++-- .../liveShare/lib/url/getImageUrlFromPageUrl.ts | 2 +- .../lib/url/spec/getImageUrlFromPageUrl.spec.ts | 2 +- .../lib/url/spec/getPageUrlFromImageUrl.spec.ts | 2 +- .../liveShare/lib/url/spec/urlRoundTrip.spec.ts | 4 ++-- .../contentHandlers/liveShare/liveShareHandlers.ts | 4 ++-- .../contentHandlers/liveShare/spec/liveShare.spec.ts | 2 +- .../proxyOriginal/lib/spec/exists.spec.ts | 2 +- .../contentHandlers/proxyOriginal/proxyOriginal.ts | 8 ++++---- src/modules/metaServer/index.ts | 2 +- src/modules/metaServer/lib/aws/config/accessKeyId.ts | 2 +- src/modules/metaServer/lib/aws/config/region.ts | 2 +- .../metaServer/lib/aws/config/secretAccessKey.ts | 2 +- .../metaServer/lib/aws/s3/getAwsS3ClientConfig.ts | 2 +- src/modules/metaServer/lib/aws/s3/getDefaultBucket.ts | 2 +- .../metaServer/lib/aws/s3/hasAwsS3ClientConfig.ts | 2 +- .../metaServer/lib/aws/s3/store/spec/S3Store.spec.ts | 6 +++--- src/modules/metaServer/lib/browser/useBrowser.ts | 4 ++-- .../spec/getArchivistDomainFromExploreUri.spec.ts | 2 +- .../lib/domain/spec/isArchivistDomain.spec.ts | 2 +- .../metaServer/lib/domain/spec/isExploreDomain.spec.ts | 2 +- .../metaServer/lib/domain/spec/isLocalhost.spec.ts | 2 +- .../metaServer/lib/env/generateEnvVarHelpers.ts | 6 +++--- .../metaServer/lib/file/spec/getContentType.spec.ts | 2 +- .../lib/file/spec/isKnownFileExtension.spec.ts | 2 +- .../metaServer/lib/head/spec/getRenderedHead.spec.ts | 4 ++-- .../metaServer/lib/image/generateImageFromCanvas.ts | 2 +- .../metaServer/lib/image/generateImageFromPage.ts | 6 +++--- .../lib/image/spec/generateImageFromPage.spec.ts | 2 +- .../twitter/spec/summaryCardImageFromPage.spec.ts | 6 +++--- .../spec/summaryCardWithLargeImageFromPage.spec.ts | 6 +++--- .../lib/image/twitter/summaryCardImageFromPage.ts | 2 +- .../image/twitter/summaryCardWithLargeImageFromPage.ts | 4 ++-- .../metaServer/lib/page/PageRenderingOptions.ts | 2 +- .../metaServer/lib/page/usePage/spec/usePage.spec.ts | 2 +- .../lib/page/usePage/spec/useSpaPage.spec.ts | 2 +- src/modules/metaServer/lib/page/usePage/usePage.ts | 8 ++++---- src/modules/metaServer/lib/page/usePage/useSpaPage.ts | 8 ++++---- src/modules/metaServer/lib/path/getAdjustedPath.ts | 2 +- src/modules/metaServer/lib/path/isHtmlLike.ts | 2 +- .../lib/path/routeMatcher/createGlobMatcher.ts | 2 +- .../lib/path/routeMatcher/createRegexMatcher.ts | 2 +- .../metaServer/lib/path/spec/isHtmlLike.spec.ts | 2 +- .../metaServer/lib/repository/file/FileRepository.ts | 2 +- .../lib/repository/file/getFileRepository.ts | 8 ++++---- .../lib/repository/file/memory/MemoryFileRepository.ts | 4 ++-- .../file/memory/spec/MemoryFileRepository.spec.ts | 2 +- .../lib/repository/file/s3/S3FileRepository.ts | 8 ++++---- .../repository/file/s3/spec/S3FileRepository.spec.ts | 4 ++-- .../socialMedia/facebook/auth/canGetAppAccessToken.ts | 2 +- .../facebook/auth/spec/tryGetAppAccessToken.spec.ts | 4 ++-- .../socialMedia/facebook/auth/tryGetAppAccessToken.ts | 2 +- .../lib/socialMedia/facebook/auth/tryGetAuthInfo.ts | 2 +- .../lib/socialMedia/facebook/config/appId.ts | 2 +- .../lib/socialMedia/facebook/config/appSecret.ts | 2 +- .../facebook/share/preCacheFacebookShare.ts | 2 +- .../facebook/share/spec/preCacheFacebookShare.spec.ts | 4 ++-- src/modules/metaServer/lib/uri/getHashInfoFromUri.ts | 2 +- src/modules/metaServer/lib/uri/getUriBehindProxy.ts | 2 +- .../metaServer/lib/uri/spec/getDomainFromUri.spec.ts | 2 +- .../metaServer/lib/uri/spec/getHashInfoFromUri.spec.ts | 2 +- .../metaServer/lib/uri/spec/getUriBehindProxy.spec.ts | 2 +- src/modules/metaServer/lib/uri/spec/join.spec.ts | 2 +- .../metaServer/lib/uri/spec/queryParams.spec.ts | 2 +- .../metaServer/middleware/metaCache/MetaCacheLocals.ts | 2 +- .../metaServer/middleware/metaCache/SimpleMetaCache.ts | 2 +- .../metaServer/middleware/metaCache/middleware.ts | 6 +++--- .../middleware/metaCache/spec/SimpleMetaCache.spec.ts | 2 +- src/modules/metaServer/server/spec/index.spec.ts | 2 +- src/modules/metaServer/types/PayloadInfo.ts | 2 +- 84 files changed, 132 insertions(+), 132 deletions(-) diff --git a/src/bin/docker-build.ts b/src/bin/docker-build.ts index 47d0fae..8040e3f 100644 --- a/src/bin/docker-build.ts +++ b/src/bin/docker-build.ts @@ -1,7 +1,7 @@ import { execSync } from 'node:child_process' -import { getFlagsString } from './getFlags.js' -import { safeExit } from './safeExit.js' +import { getFlagsString } from './getFlags.ts' +import { safeExit } from './safeExit.ts' safeExit(async () => { console.log(`Docker build [${process.cwd()}]`) diff --git a/src/bin/generate-dotenv.ts b/src/bin/generate-dotenv.ts index 04334ea..af94c79 100644 --- a/src/bin/generate-dotenv.ts +++ b/src/bin/generate-dotenv.ts @@ -1,6 +1,6 @@ import { execSync } from 'node:child_process' -import { safeExit } from './safeExit.js' +import { safeExit } from './safeExit.ts' safeExit(() => { console.log(`Generate .env [${process.cwd()}]`) diff --git a/src/bin/start-meta.ts b/src/bin/start-meta.ts index 24b4827..cdc995e 100644 --- a/src/bin/start-meta.ts +++ b/src/bin/start-meta.ts @@ -1,6 +1,6 @@ import { getEnvFromAws, tryParseInt } from '@xylabs/sdk-api-express-ecs' -import { metaServer } from '../modules/index.js' +import { metaServer } from '../modules/index.ts' void (async () => { const port = tryParseInt(process.env.PORT) || 8083 diff --git a/src/modules/metaServer/contentHandlers/debug/configureDebug.ts b/src/modules/metaServer/contentHandlers/debug/configureDebug.ts index a922529..661fe80 100644 --- a/src/modules/metaServer/contentHandlers/debug/configureDebug.ts +++ b/src/modules/metaServer/contentHandlers/debug/configureDebug.ts @@ -3,7 +3,7 @@ import { asyncHandler } from '@xylabs/sdk-api-express-ecs' import { RequestHandler } from 'express' import { StatusCodes } from 'http-status-codes' -import { MountPathAndMiddleware } from '../../types/index.js' +import { MountPathAndMiddleware } from '../../types/index.ts' const handleStatusCode: RequestHandler = (req, res, _next) => { const { code } = req.params diff --git a/src/modules/metaServer/contentHandlers/dynamicShare/dynamicShareHandler.ts b/src/modules/metaServer/contentHandlers/dynamicShare/dynamicShareHandler.ts index 78bddd2..82d7b0d 100644 --- a/src/modules/metaServer/contentHandlers/dynamicShare/dynamicShareHandler.ts +++ b/src/modules/metaServer/contentHandlers/dynamicShare/dynamicShareHandler.ts @@ -17,8 +17,8 @@ import { RouteMatcher, stringToArrayBuffer, } from '../../lib/index.js' -import { ApplicationMiddlewareOptions, MountPathAndMiddleware } from '../../types/index.js' -import { useIndexAndDynamicPreviewImage } from './lib/index.js' +import { ApplicationMiddlewareOptions, MountPathAndMiddleware } from '../../types/index.ts' +import { useIndexAndDynamicPreviewImage } from './lib/index.ts' /** * The max-age cache control header time (in seconds) diff --git a/src/modules/metaServer/contentHandlers/dynamicShare/lib/image/spec/getImageMeta.spec.ts b/src/modules/metaServer/contentHandlers/dynamicShare/lib/image/spec/getImageMeta.spec.ts index 30c3d7d..c42f195 100644 --- a/src/modules/metaServer/contentHandlers/dynamicShare/lib/image/spec/getImageMeta.spec.ts +++ b/src/modules/metaServer/contentHandlers/dynamicShare/lib/image/spec/getImageMeta.spec.ts @@ -1,4 +1,4 @@ -import { getImageMeta } from '../getImageMeta.js' +import { getImageMeta } from '../getImageMeta.ts' describe('getImageMeta', () => { const cases = [ diff --git a/src/modules/metaServer/contentHandlers/dynamicShare/spec/dynamicShare.spec.ts b/src/modules/metaServer/contentHandlers/dynamicShare/spec/dynamicShare.spec.ts index d9f87fc..0971888 100644 --- a/src/modules/metaServer/contentHandlers/dynamicShare/spec/dynamicShare.spec.ts +++ b/src/modules/metaServer/contentHandlers/dynamicShare/spec/dynamicShare.spec.ts @@ -3,7 +3,7 @@ import { Server } from 'node:http' import { StatusCodes } from 'http-status-codes' import { SuperTest, Test } from 'supertest' -import { getServerOnPort } from '../../../spec/index.js' +import { getServerOnPort } from '../../../spec/index.ts' describe('dynamicShare', () => { const port = 12_346 diff --git a/src/modules/metaServer/contentHandlers/liveShare/lib/image/ensureImageExists.ts b/src/modules/metaServer/contentHandlers/liveShare/lib/image/ensureImageExists.ts index fee5f3a..5d7e256 100644 --- a/src/modules/metaServer/contentHandlers/liveShare/lib/image/ensureImageExists.ts +++ b/src/modules/metaServer/contentHandlers/liveShare/lib/image/ensureImageExists.ts @@ -1,10 +1,10 @@ import { forget } from '@xylabs/forget' -import { FileRepository, preCacheFacebookShare } from '../../../../lib/index.js' -import { generateImage } from './generateImage.js' -import { tryGetPreviewUrlFromPage } from './getPreviewUrlFromPage.js' -import { height, width } from './imageGenerator.js' -import { pageImageExists } from './pageImageExists.js' +import { FileRepository, preCacheFacebookShare } from '../../../../lib/index.ts' +import { generateImage } from './generateImage.ts' +import { tryGetPreviewUrlFromPage } from './getPreviewUrlFromPage.ts' +import { height, width } from './imageGenerator.ts' +import { pageImageExists } from './pageImageExists.ts' /** * Ensures a page preview image exists for the supplied uri. If the image does not exist, diff --git a/src/modules/metaServer/contentHandlers/liveShare/lib/image/generateImage.ts b/src/modules/metaServer/contentHandlers/liveShare/lib/image/generateImage.ts index 1c63e1f..2221d33 100644 --- a/src/modules/metaServer/contentHandlers/liveShare/lib/image/generateImage.ts +++ b/src/modules/metaServer/contentHandlers/liveShare/lib/image/generateImage.ts @@ -1,6 +1,6 @@ -import { FileRepository, RepositoryFile, useSpaPage } from '../../../../lib/index.js' -import { getImageUrlFromPageUrl } from '../url/index.js' -import { imageGenerator, type } from './imageGenerator.js' +import { FileRepository, RepositoryFile, useSpaPage } from '../../../../lib/index.ts' +import { getImageUrlFromPageUrl } from '../url/index.ts' +import { imageGenerator, type } from './imageGenerator.ts' export const generateImage = (url: string, previewUrl: string, imageRepository: FileRepository, width: number, height: number) => { return useSpaPage(previewUrl, async (page) => { diff --git a/src/modules/metaServer/contentHandlers/liveShare/lib/image/getImageMeta.ts b/src/modules/metaServer/contentHandlers/liveShare/lib/image/getImageMeta.ts index 2136cdd..ef4003d 100644 --- a/src/modules/metaServer/contentHandlers/liveShare/lib/image/getImageMeta.ts +++ b/src/modules/metaServer/contentHandlers/liveShare/lib/image/getImageMeta.ts @@ -1,7 +1,7 @@ import { Meta, OpenGraphMeta, TwitterMeta } from '@xyo-network/sdk-meta' -import { defaultViewportSize } from '../../../../lib/index.js' -import { getImageUrlFromPageUrl } from '../url/index.js' +import { defaultViewportSize } from '../../../../lib/index.ts' +import { getImageUrlFromPageUrl } from '../url/index.ts' /** * Generates the expected metadata for the resultant preview image of a Live Share page diff --git a/src/modules/metaServer/contentHandlers/liveShare/lib/image/getPreviewUrlFromPage.ts b/src/modules/metaServer/contentHandlers/liveShare/lib/image/getPreviewUrlFromPage.ts index 81aa5d6..2aa37b1 100644 --- a/src/modules/metaServer/contentHandlers/liveShare/lib/image/getPreviewUrlFromPage.ts +++ b/src/modules/metaServer/contentHandlers/liveShare/lib/image/getPreviewUrlFromPage.ts @@ -2,7 +2,7 @@ import { assertEx } from '@xylabs/assert' import he from 'he' const { decode } = he -import { useSpaPage } from '../../../../lib/index.js' +import { useSpaPage } from '../../../../lib/index.ts' /** * The property name of the meta element diff --git a/src/modules/metaServer/contentHandlers/liveShare/lib/image/pageImageExists.ts b/src/modules/metaServer/contentHandlers/liveShare/lib/image/pageImageExists.ts index 2f0b243..73f18a3 100644 --- a/src/modules/metaServer/contentHandlers/liveShare/lib/image/pageImageExists.ts +++ b/src/modules/metaServer/contentHandlers/liveShare/lib/image/pageImageExists.ts @@ -1,5 +1,5 @@ -import { FileRepository } from '../../../../lib/index.js' -import { getImageUrlFromPageUrl } from '../url/index.js' +import { FileRepository } from '../../../../lib/index.ts' +import { getImageUrlFromPageUrl } from '../url/index.ts' /** * Checks if the page image exists in the cache diff --git a/src/modules/metaServer/contentHandlers/liveShare/lib/image/spec/ensureImageExists.perf.spec.ts b/src/modules/metaServer/contentHandlers/liveShare/lib/image/spec/ensureImageExists.perf.spec.ts index 47e8b92..172976d 100644 --- a/src/modules/metaServer/contentHandlers/liveShare/lib/image/spec/ensureImageExists.perf.spec.ts +++ b/src/modules/metaServer/contentHandlers/liveShare/lib/image/spec/ensureImageExists.perf.spec.ts @@ -1,5 +1,5 @@ -import { MemoryFileRepository } from '../../../../../lib/index.js' -import { ensureImageExists } from '../ensureImageExists.js' +import { MemoryFileRepository } from '../../../../../lib/index.ts' +import { ensureImageExists } from '../ensureImageExists.ts' describe.skip('ensureImageExists', () => { let average = 0 diff --git a/src/modules/metaServer/contentHandlers/liveShare/lib/image/spec/getImageMeta.spec.ts b/src/modules/metaServer/contentHandlers/liveShare/lib/image/spec/getImageMeta.spec.ts index 30c3d7d..c42f195 100644 --- a/src/modules/metaServer/contentHandlers/liveShare/lib/image/spec/getImageMeta.spec.ts +++ b/src/modules/metaServer/contentHandlers/liveShare/lib/image/spec/getImageMeta.spec.ts @@ -1,4 +1,4 @@ -import { getImageMeta } from '../getImageMeta.js' +import { getImageMeta } from '../getImageMeta.ts' describe('getImageMeta', () => { const cases = [ diff --git a/src/modules/metaServer/contentHandlers/liveShare/lib/pageStrategies/useIndexAndDeferredPreviewImage/useIndexAndDeferredPreviewImage.ts b/src/modules/metaServer/contentHandlers/liveShare/lib/pageStrategies/useIndexAndDeferredPreviewImage/useIndexAndDeferredPreviewImage.ts index 31804d6..ad2ed81 100644 --- a/src/modules/metaServer/contentHandlers/liveShare/lib/pageStrategies/useIndexAndDeferredPreviewImage/useIndexAndDeferredPreviewImage.ts +++ b/src/modules/metaServer/contentHandlers/liveShare/lib/pageStrategies/useIndexAndDeferredPreviewImage/useIndexAndDeferredPreviewImage.ts @@ -1,7 +1,7 @@ import { metaBuilder } from '@xyo-network/sdk-meta' -import { FileRepository } from '../../../../../lib/index.js' -import { ensureImageExists, getImageMeta } from '../../image/index.js' +import { FileRepository } from '../../../../../lib/index.ts' +import { ensureImageExists, getImageMeta } from '../../image/index.ts' export const useIndexAndDeferredPreviewImage = (url: string, imageRepository: FileRepository, indexHtml: string): string => { try { diff --git a/src/modules/metaServer/contentHandlers/liveShare/lib/url/getImageUrlFromPageUrl.ts b/src/modules/metaServer/contentHandlers/liveShare/lib/url/getImageUrlFromPageUrl.ts index 004f99b..8900b5e 100644 --- a/src/modules/metaServer/contentHandlers/liveShare/lib/url/getImageUrlFromPageUrl.ts +++ b/src/modules/metaServer/contentHandlers/liveShare/lib/url/getImageUrlFromPageUrl.ts @@ -1,4 +1,4 @@ -import { join, removeQueryParam } from '../../../../lib/index.js' +import { join, removeQueryParam } from '../../../../lib/index.ts' /** * Generates the url of the preview image for a Live Share page diff --git a/src/modules/metaServer/contentHandlers/liveShare/lib/url/spec/getImageUrlFromPageUrl.spec.ts b/src/modules/metaServer/contentHandlers/liveShare/lib/url/spec/getImageUrlFromPageUrl.spec.ts index f17d4c1..333bc8a 100644 --- a/src/modules/metaServer/contentHandlers/liveShare/lib/url/spec/getImageUrlFromPageUrl.spec.ts +++ b/src/modules/metaServer/contentHandlers/liveShare/lib/url/spec/getImageUrlFromPageUrl.spec.ts @@ -1,4 +1,4 @@ -import { getImageUrlFromPageUrl } from '../getImageUrlFromPageUrl.js' +import { getImageUrlFromPageUrl } from '../getImageUrlFromPageUrl.ts' describe('getImageUrl', () => { const cases: [width: number, height: number][] = [ diff --git a/src/modules/metaServer/contentHandlers/liveShare/lib/url/spec/getPageUrlFromImageUrl.spec.ts b/src/modules/metaServer/contentHandlers/liveShare/lib/url/spec/getPageUrlFromImageUrl.spec.ts index b158742..d80200a 100644 --- a/src/modules/metaServer/contentHandlers/liveShare/lib/url/spec/getPageUrlFromImageUrl.spec.ts +++ b/src/modules/metaServer/contentHandlers/liveShare/lib/url/spec/getPageUrlFromImageUrl.spec.ts @@ -1,4 +1,4 @@ -import { getPageUrlFromImageUrl } from '../getPageUrlFromImageUrl.js' +import { getPageUrlFromImageUrl } from '../getPageUrlFromImageUrl.ts' describe('getPageUrlFromImageUrl', () => { const cases: [imageUrl: string, pageUrl: string][] = [ diff --git a/src/modules/metaServer/contentHandlers/liveShare/lib/url/spec/urlRoundTrip.spec.ts b/src/modules/metaServer/contentHandlers/liveShare/lib/url/spec/urlRoundTrip.spec.ts index 2ed6777..eb82d68 100644 --- a/src/modules/metaServer/contentHandlers/liveShare/lib/url/spec/urlRoundTrip.spec.ts +++ b/src/modules/metaServer/contentHandlers/liveShare/lib/url/spec/urlRoundTrip.spec.ts @@ -1,5 +1,5 @@ -import { getImageUrlFromPageUrl } from '../getImageUrlFromPageUrl.js' -import { getPageUrlFromImageUrl } from '../getPageUrlFromImageUrl.js' +import { getImageUrlFromPageUrl } from '../getImageUrlFromPageUrl.ts' +import { getPageUrlFromImageUrl } from '../getPageUrlFromImageUrl.ts' describe('url helpers', () => { const cases: [pageUrl: string][] = [ diff --git a/src/modules/metaServer/contentHandlers/liveShare/liveShareHandlers.ts b/src/modules/metaServer/contentHandlers/liveShare/liveShareHandlers.ts index dbef52d..742058a 100644 --- a/src/modules/metaServer/contentHandlers/liveShare/liveShareHandlers.ts +++ b/src/modules/metaServer/contentHandlers/liveShare/liveShareHandlers.ts @@ -19,8 +19,8 @@ import { RouteMatcher, stringToArrayBuffer, } from '../../lib/index.js' -import { ApplicationMiddlewareOptions, MountPathAndMiddleware } from '../../types/index.js' -import { ensureImageExists, getPageUrlFromImageUrl, useIndexAndDeferredPreviewImage } from './lib/index.js' +import { ApplicationMiddlewareOptions, MountPathAndMiddleware } from '../../types/index.ts' +import { ensureImageExists, getPageUrlFromImageUrl, useIndexAndDeferredPreviewImage } from './lib/index.ts' /** * The max-age cache control header time (in seconds) diff --git a/src/modules/metaServer/contentHandlers/liveShare/spec/liveShare.spec.ts b/src/modules/metaServer/contentHandlers/liveShare/spec/liveShare.spec.ts index e8a85fa..283fcd0 100644 --- a/src/modules/metaServer/contentHandlers/liveShare/spec/liveShare.spec.ts +++ b/src/modules/metaServer/contentHandlers/liveShare/spec/liveShare.spec.ts @@ -4,7 +4,7 @@ import { StatusCodes } from 'http-status-codes' import { MatchImageSnapshotOptions, toMatchImageSnapshot } from 'jest-image-snapshot' import { SuperTest, Test } from 'supertest' -import { getServerOnPort } from '../../../spec/index.js' +import { getServerOnPort } from '../../../spec/index.ts' describe('liveShare', () => { const port = 12_345 diff --git a/src/modules/metaServer/contentHandlers/proxyOriginal/lib/spec/exists.spec.ts b/src/modules/metaServer/contentHandlers/proxyOriginal/lib/spec/exists.spec.ts index f96e855..b6054e4 100644 --- a/src/modules/metaServer/contentHandlers/proxyOriginal/lib/spec/exists.spec.ts +++ b/src/modules/metaServer/contentHandlers/proxyOriginal/lib/spec/exists.spec.ts @@ -1,4 +1,4 @@ -import { exists } from '../exists.js' +import { exists } from '../exists.ts' describe('exists', () => { describe('when path exists returns true', () => { diff --git a/src/modules/metaServer/contentHandlers/proxyOriginal/proxyOriginal.ts b/src/modules/metaServer/contentHandlers/proxyOriginal/proxyOriginal.ts index 2461d94..56ea6c7 100644 --- a/src/modules/metaServer/contentHandlers/proxyOriginal/proxyOriginal.ts +++ b/src/modules/metaServer/contentHandlers/proxyOriginal/proxyOriginal.ts @@ -9,10 +9,10 @@ import { StatusCodes } from 'http-status-codes' import { LRUCache } from 'lru-cache' import serveStatic, { ServeStaticOptions } from 'serve-static' -import { getAdjustedPath, isHtmlLike } from '../../lib/index.js' -import { MetaCacheLocals } from '../../middleware/index.js' -import { ApplicationMiddlewareOptions, MountPathAndMiddleware } from '../../types/index.js' -import { exists } from './lib/index.js' +import { getAdjustedPath, isHtmlLike } from '../../lib/index.ts' +import { MetaCacheLocals } from '../../middleware/index.ts' +import { ApplicationMiddlewareOptions, MountPathAndMiddleware } from '../../types/index.ts' +import { exists } from './lib/index.ts' /** * The max-age cache control header time (in seconds) diff --git a/src/modules/metaServer/index.ts b/src/modules/metaServer/index.ts index 41e3bb3..d269fc9 100644 --- a/src/modules/metaServer/index.ts +++ b/src/modules/metaServer/index.ts @@ -1,4 +1,4 @@ -import { server } from './server/index.js' +import { server } from './server/index.ts' export const metaServer = (port?: number) => { server(port) diff --git a/src/modules/metaServer/lib/aws/config/accessKeyId.ts b/src/modules/metaServer/lib/aws/config/accessKeyId.ts index d0d8846..5ed4051 100644 --- a/src/modules/metaServer/lib/aws/config/accessKeyId.ts +++ b/src/modules/metaServer/lib/aws/config/accessKeyId.ts @@ -1,3 +1,3 @@ -import { generateEnvVarHelpers } from '../../env/index.js' +import { generateEnvVarHelpers } from '../../env/index.ts' export const { hasEnvVar: hasAccessKeyId, tryGetEnvVar: tryGetAccessKeyId, getEnvVar: getAccessKeyId } = generateEnvVarHelpers('AWS_ACCESS_KEY_ID') diff --git a/src/modules/metaServer/lib/aws/config/region.ts b/src/modules/metaServer/lib/aws/config/region.ts index 06656ad..5e3d8f1 100644 --- a/src/modules/metaServer/lib/aws/config/region.ts +++ b/src/modules/metaServer/lib/aws/config/region.ts @@ -1,4 +1,4 @@ -import { generateEnvVarHelpers } from '../../env/index.js' +import { generateEnvVarHelpers } from '../../env/index.ts' /** * Checks if the AWS_DEFAULT_REGION environment variable is defined diff --git a/src/modules/metaServer/lib/aws/config/secretAccessKey.ts b/src/modules/metaServer/lib/aws/config/secretAccessKey.ts index abd8557..d11331c 100644 --- a/src/modules/metaServer/lib/aws/config/secretAccessKey.ts +++ b/src/modules/metaServer/lib/aws/config/secretAccessKey.ts @@ -1,4 +1,4 @@ -import { generateEnvVarHelpers } from '../../env/index.js' +import { generateEnvVarHelpers } from '../../env/index.ts' export const { hasEnvVar: hasSecretAccessKey, diff --git a/src/modules/metaServer/lib/aws/s3/getAwsS3ClientConfig.ts b/src/modules/metaServer/lib/aws/s3/getAwsS3ClientConfig.ts index f09d4b4..c51315a 100644 --- a/src/modules/metaServer/lib/aws/s3/getAwsS3ClientConfig.ts +++ b/src/modules/metaServer/lib/aws/s3/getAwsS3ClientConfig.ts @@ -1,6 +1,6 @@ import { S3ClientConfig } from '@aws-sdk/client-s3' -import { getAccessKeyId, getRegionOrDefault, getSecretAccessKey, hasAccessKeyId, hasSecretAccessKey } from '../config/index.js' +import { getAccessKeyId, getRegionOrDefault, getSecretAccessKey, hasAccessKeyId, hasSecretAccessKey } from '../config/index.ts' export const getAwsS3ClientConfig: () => S3ClientConfig = () => { const config: S3ClientConfig = { diff --git a/src/modules/metaServer/lib/aws/s3/getDefaultBucket.ts b/src/modules/metaServer/lib/aws/s3/getDefaultBucket.ts index c2ad90a..e6dff0c 100644 --- a/src/modules/metaServer/lib/aws/s3/getDefaultBucket.ts +++ b/src/modules/metaServer/lib/aws/s3/getDefaultBucket.ts @@ -1,4 +1,4 @@ -import { generateEnvVarHelpers } from '../../env/index.js' +import { generateEnvVarHelpers } from '../../env/index.ts' /** * Determines the default AWS S3 bucket to use. diff --git a/src/modules/metaServer/lib/aws/s3/hasAwsS3ClientConfig.ts b/src/modules/metaServer/lib/aws/s3/hasAwsS3ClientConfig.ts index 27927f8..1877e8c 100644 --- a/src/modules/metaServer/lib/aws/s3/hasAwsS3ClientConfig.ts +++ b/src/modules/metaServer/lib/aws/s3/hasAwsS3ClientConfig.ts @@ -1,4 +1,4 @@ -import { hasAccessKeyId, hasSecretAccessKey } from '../config/index.js' +import { hasAccessKeyId, hasSecretAccessKey } from '../config/index.ts' /** * Checks if the enough information exists in the environment to create an AWS S3 client diff --git a/src/modules/metaServer/lib/aws/s3/store/spec/S3Store.spec.ts b/src/modules/metaServer/lib/aws/s3/store/spec/S3Store.spec.ts index 9b5bdbd..24b920f 100644 --- a/src/modules/metaServer/lib/aws/s3/store/spec/S3Store.spec.ts +++ b/src/modules/metaServer/lib/aws/s3/store/spec/S3Store.spec.ts @@ -4,9 +4,9 @@ import Path from 'node:path' import { S3ClientConfig } from '@aws-sdk/client-s3' import { describeIf } from '@xylabs/jest-helpers' -import { getAwsS3ClientConfig } from '../../getAwsS3ClientConfig.js' -import { getDefaultTestBucket, hasBucket } from '../../getDefaultBucket.js' -import { S3Store } from '../S3Store.js' +import { getAwsS3ClientConfig } from '../../getAwsS3ClientConfig.ts' +import { getDefaultTestBucket, hasBucket } from '../../getDefaultBucket.ts' +import { S3Store } from '../S3Store.ts' describeIf(hasBucket())('S3Store', () => { let config: S3ClientConfig diff --git a/src/modules/metaServer/lib/browser/useBrowser.ts b/src/modules/metaServer/lib/browser/useBrowser.ts index 92b2758..1a63460 100644 --- a/src/modules/metaServer/lib/browser/useBrowser.ts +++ b/src/modules/metaServer/lib/browser/useBrowser.ts @@ -1,7 +1,7 @@ import { Browser, launch, Viewport } from 'puppeteer' -import { getBrowserArgs } from './getBrowserArgs.js' -import { defaultViewportSize } from './ViewPortSize.js' +import { getBrowserArgs } from './getBrowserArgs.ts' +import { defaultViewportSize } from './ViewPortSize.ts' export const viewPortDefaults: Viewport = { ...defaultViewportSize, diff --git a/src/modules/metaServer/lib/domain/spec/getArchivistDomainFromExploreUri.spec.ts b/src/modules/metaServer/lib/domain/spec/getArchivistDomainFromExploreUri.spec.ts index 535e590..30eff43 100644 --- a/src/modules/metaServer/lib/domain/spec/getArchivistDomainFromExploreUri.spec.ts +++ b/src/modules/metaServer/lib/domain/spec/getArchivistDomainFromExploreUri.spec.ts @@ -1,4 +1,4 @@ -import { getArchivistDomainFromUri, networkToArchivistUri } from '../getArchivistDomainFromUri.js' +import { getArchivistDomainFromUri, networkToArchivistUri } from '../getArchivistDomainFromUri.ts' const prodUrls = [ 'https://node.xyo.network', diff --git a/src/modules/metaServer/lib/domain/spec/isArchivistDomain.spec.ts b/src/modules/metaServer/lib/domain/spec/isArchivistDomain.spec.ts index a734702..4b04008 100644 --- a/src/modules/metaServer/lib/domain/spec/isArchivistDomain.spec.ts +++ b/src/modules/metaServer/lib/domain/spec/isArchivistDomain.spec.ts @@ -1,4 +1,4 @@ -import { isArchivistDomain } from '../isArchivistDomain.js' +import { isArchivistDomain } from '../isArchivistDomain.ts' const archivistDomains = ['https://beta.api.archivist.xyo.network', 'https://api.archivist.xyo.network', 'http://localhost:8080'] diff --git a/src/modules/metaServer/lib/domain/spec/isExploreDomain.spec.ts b/src/modules/metaServer/lib/domain/spec/isExploreDomain.spec.ts index 11d40e1..d06989c 100644 --- a/src/modules/metaServer/lib/domain/spec/isExploreDomain.spec.ts +++ b/src/modules/metaServer/lib/domain/spec/isExploreDomain.spec.ts @@ -1,4 +1,4 @@ -import { isExploreDomain } from '../isExploreDomain.js' +import { isExploreDomain } from '../isExploreDomain.ts' const exploreDomains = ['https://beta.explore.xyo.network', 'https://explore.xyo.network', 'http://localhost:3000'] diff --git a/src/modules/metaServer/lib/domain/spec/isLocalhost.spec.ts b/src/modules/metaServer/lib/domain/spec/isLocalhost.spec.ts index 253187c..2144bb0 100644 --- a/src/modules/metaServer/lib/domain/spec/isLocalhost.spec.ts +++ b/src/modules/metaServer/lib/domain/spec/isLocalhost.spec.ts @@ -1,4 +1,4 @@ -import { isLocalhost } from '../isLocalhost.js' +import { isLocalhost } from '../isLocalhost.ts' const localhostStrings = [ 'localhost', diff --git a/src/modules/metaServer/lib/env/generateEnvVarHelpers.ts b/src/modules/metaServer/lib/env/generateEnvVarHelpers.ts index 96dcc72..8cbe591 100644 --- a/src/modules/metaServer/lib/env/generateEnvVarHelpers.ts +++ b/src/modules/metaServer/lib/env/generateEnvVarHelpers.ts @@ -1,6 +1,6 @@ -import { getEnvVar } from './getEnvVar.js' -import { hasEnvVar } from './hasEnvVar.js' -import { tryGetEnvVar } from './tryGetEnvVar.js' +import { getEnvVar } from './getEnvVar.ts' +import { hasEnvVar } from './hasEnvVar.ts' +import { tryGetEnvVar } from './tryGetEnvVar.ts' /** * Helper methods for interacting with an ENV VAR diff --git a/src/modules/metaServer/lib/file/spec/getContentType.spec.ts b/src/modules/metaServer/lib/file/spec/getContentType.spec.ts index 61422df..6ce86da 100644 --- a/src/modules/metaServer/lib/file/spec/getContentType.spec.ts +++ b/src/modules/metaServer/lib/file/spec/getContentType.spec.ts @@ -1,4 +1,4 @@ -import { getContentType } from '../getContentType.js' +import { getContentType } from '../getContentType.ts' const pathsWithRealExtensions = [ 'index.html', diff --git a/src/modules/metaServer/lib/file/spec/isKnownFileExtension.spec.ts b/src/modules/metaServer/lib/file/spec/isKnownFileExtension.spec.ts index 824bd71..4a9edea 100644 --- a/src/modules/metaServer/lib/file/spec/isKnownFileExtension.spec.ts +++ b/src/modules/metaServer/lib/file/spec/isKnownFileExtension.spec.ts @@ -1,4 +1,4 @@ -import { isKnownFileExtension } from '../isKnownFileExtension.js' +import { isKnownFileExtension } from '../isKnownFileExtension.ts' const pathsWithRealExtensions = [ 'index.html', diff --git a/src/modules/metaServer/lib/head/spec/getRenderedHead.spec.ts b/src/modules/metaServer/lib/head/spec/getRenderedHead.spec.ts index cf07e2b..f4a9ecc 100644 --- a/src/modules/metaServer/lib/head/spec/getRenderedHead.spec.ts +++ b/src/modules/metaServer/lib/head/spec/getRenderedHead.spec.ts @@ -1,5 +1,5 @@ -import { usePage } from '../../page/index.js' -import { getRenderedHead, getRenderedMeta, getRenderedMetaElements, getSelectiveHeadElements } from '../getRenderedHead.js' +import { usePage } from '../../page/index.ts' +import { getRenderedHead, getRenderedMeta, getRenderedMetaElements, getSelectiveHeadElements } from '../getRenderedHead.ts' const uris = ['https://www.youtube.com/watch?v=Kauv7MVPcsA'] diff --git a/src/modules/metaServer/lib/image/generateImageFromCanvas.ts b/src/modules/metaServer/lib/image/generateImageFromCanvas.ts index 89f762e..83e5259 100644 --- a/src/modules/metaServer/lib/image/generateImageFromCanvas.ts +++ b/src/modules/metaServer/lib/image/generateImageFromCanvas.ts @@ -1,4 +1,4 @@ -import { PageRenderingOptions, usePage } from '../page/index.js' +import { PageRenderingOptions, usePage } from '../page/index.ts' export interface CanvasImageOptions extends PageRenderingOptions { canvasSelector: string diff --git a/src/modules/metaServer/lib/image/generateImageFromPage.ts b/src/modules/metaServer/lib/image/generateImageFromPage.ts index 89d93fe..5013e1f 100644 --- a/src/modules/metaServer/lib/image/generateImageFromPage.ts +++ b/src/modules/metaServer/lib/image/generateImageFromPage.ts @@ -1,8 +1,8 @@ import { Page, ScreenshotOptions } from 'puppeteer' -import { defaultPageRenderingOptions, PageRenderingOptions, usePage } from '../page/index.js' -import { ImageEncoding } from './ImageEncoding.js' -import { ImageType } from './ImageType.js' +import { defaultPageRenderingOptions, PageRenderingOptions, usePage } from '../page/index.ts' +import { ImageEncoding } from './ImageEncoding.ts' +import { ImageType } from './ImageType.ts' export type PageImageOptions = PageRenderingOptions & { encoding?: ImageEncoding diff --git a/src/modules/metaServer/lib/image/spec/generateImageFromPage.spec.ts b/src/modules/metaServer/lib/image/spec/generateImageFromPage.spec.ts index 6156163..0a37465 100644 --- a/src/modules/metaServer/lib/image/spec/generateImageFromPage.spec.ts +++ b/src/modules/metaServer/lib/image/spec/generateImageFromPage.spec.ts @@ -1,4 +1,4 @@ -import { renderAndGenerateImageFromPage } from '../generateImageFromPage.js' +import { renderAndGenerateImageFromPage } from '../generateImageFromPage.ts' describe('generateImageFromPage', () => { it('generates image from page', async () => { diff --git a/src/modules/metaServer/lib/image/twitter/spec/summaryCardImageFromPage.spec.ts b/src/modules/metaServer/lib/image/twitter/spec/summaryCardImageFromPage.spec.ts index 9bc8863..c788b3c 100644 --- a/src/modules/metaServer/lib/image/twitter/spec/summaryCardImageFromPage.spec.ts +++ b/src/modules/metaServer/lib/image/twitter/spec/summaryCardImageFromPage.spec.ts @@ -1,8 +1,8 @@ import { MatchImageSnapshotOptions, toMatchImageSnapshot } from 'jest-image-snapshot' -import { usePage } from '../../../page/index.js' -import { join } from '../../../uri/index.js' -import { summaryCardImageFromPage } from '../summaryCardImageFromPage.js' +import { usePage } from '../../../page/index.ts' +import { join } from '../../../uri/index.ts' +import { summaryCardImageFromPage } from '../summaryCardImageFromPage.ts' const opts: MatchImageSnapshotOptions = { customDiffConfig: { diff --git a/src/modules/metaServer/lib/image/twitter/spec/summaryCardWithLargeImageFromPage.spec.ts b/src/modules/metaServer/lib/image/twitter/spec/summaryCardWithLargeImageFromPage.spec.ts index c8ea780..5619619 100644 --- a/src/modules/metaServer/lib/image/twitter/spec/summaryCardWithLargeImageFromPage.spec.ts +++ b/src/modules/metaServer/lib/image/twitter/spec/summaryCardWithLargeImageFromPage.spec.ts @@ -1,8 +1,8 @@ import { MatchImageSnapshotOptions, toMatchImageSnapshot } from 'jest-image-snapshot' -import { usePage } from '../../../page/index.js' -import { join } from '../../../uri/index.js' -import { summaryCardWithLargeImageFromPage } from '../summaryCardWithLargeImageFromPage.js' +import { usePage } from '../../../page/index.ts' +import { join } from '../../../uri/index.ts' +import { summaryCardWithLargeImageFromPage } from '../summaryCardWithLargeImageFromPage.ts' const opts: MatchImageSnapshotOptions = { customDiffConfig: { diff --git a/src/modules/metaServer/lib/image/twitter/summaryCardImageFromPage.ts b/src/modules/metaServer/lib/image/twitter/summaryCardImageFromPage.ts index 136698f..71572b1 100644 --- a/src/modules/metaServer/lib/image/twitter/summaryCardImageFromPage.ts +++ b/src/modules/metaServer/lib/image/twitter/summaryCardImageFromPage.ts @@ -1,6 +1,6 @@ import { Page, ScreenshotOptions, Viewport } from 'puppeteer' -import { generateImageBufferFromPage } from '../generateImageFromPage.js' +import { generateImageBufferFromPage } from '../generateImageFromPage.ts' const opts: ScreenshotOptions = { encoding: 'binary', diff --git a/src/modules/metaServer/lib/image/twitter/summaryCardWithLargeImageFromPage.ts b/src/modules/metaServer/lib/image/twitter/summaryCardWithLargeImageFromPage.ts index c35b5fe..a288c29 100644 --- a/src/modules/metaServer/lib/image/twitter/summaryCardWithLargeImageFromPage.ts +++ b/src/modules/metaServer/lib/image/twitter/summaryCardWithLargeImageFromPage.ts @@ -1,7 +1,7 @@ import { Page, ScreenshotOptions, Viewport } from 'puppeteer' -import { defaultViewportSize } from '../../browser/index.js' -import { generateImageBufferFromPage } from '../generateImageFromPage.js' +import { defaultViewportSize } from '../../browser/index.ts' +import { generateImageBufferFromPage } from '../generateImageFromPage.ts' const opts: ScreenshotOptions = { encoding: 'binary', diff --git a/src/modules/metaServer/lib/page/PageRenderingOptions.ts b/src/modules/metaServer/lib/page/PageRenderingOptions.ts index b74f8d1..34e101a 100644 --- a/src/modules/metaServer/lib/page/PageRenderingOptions.ts +++ b/src/modules/metaServer/lib/page/PageRenderingOptions.ts @@ -1,6 +1,6 @@ import { WaitForOptions } from 'puppeteer' -import { ViewPortSize } from '../browser/index.js' +import { ViewPortSize } from '../browser/index.ts' export type PageRenderingOptions = WaitForOptions & { viewportSize?: ViewPortSize diff --git a/src/modules/metaServer/lib/page/usePage/spec/usePage.spec.ts b/src/modules/metaServer/lib/page/usePage/spec/usePage.spec.ts index ac6e6d8..12a10f2 100644 --- a/src/modules/metaServer/lib/page/usePage/spec/usePage.spec.ts +++ b/src/modules/metaServer/lib/page/usePage/spec/usePage.spec.ts @@ -1,4 +1,4 @@ -import { usePage } from '../usePage.js' +import { usePage } from '../usePage.ts' const waitForElementToInclude = (selector: string, expectedValue: string) => { const element = document.querySelector(selector) diff --git a/src/modules/metaServer/lib/page/usePage/spec/useSpaPage.spec.ts b/src/modules/metaServer/lib/page/usePage/spec/useSpaPage.spec.ts index 2e07f1d..bbe2fd6 100644 --- a/src/modules/metaServer/lib/page/usePage/spec/useSpaPage.spec.ts +++ b/src/modules/metaServer/lib/page/usePage/spec/useSpaPage.spec.ts @@ -1,4 +1,4 @@ -import { useSpaPage } from '../useSpaPage.js' +import { useSpaPage } from '../useSpaPage.ts' describe('useSpaPage', () => { const uri = 'https://react.dev/learn' diff --git a/src/modules/metaServer/lib/page/usePage/usePage.ts b/src/modules/metaServer/lib/page/usePage/usePage.ts index 3ed28a8..23b8265 100644 --- a/src/modules/metaServer/lib/page/usePage/usePage.ts +++ b/src/modules/metaServer/lib/page/usePage/usePage.ts @@ -1,10 +1,10 @@ import { forget } from '@xylabs/forget' import { Browser, Page, Viewport, WaitForOptions } from 'puppeteer' -import { defaultViewportSize, useBrowser } from '../../browser/index.js' -import { PageRenderingOptions } from '../PageRenderingOptions.js' -import { waitUntil } from './defaults.js' -import { getBrowserPage } from './getBrowserPage.js' +import { defaultViewportSize, useBrowser } from '../../browser/index.ts' +import { PageRenderingOptions } from '../PageRenderingOptions.ts' +import { waitUntil } from './defaults.ts' +import { getBrowserPage } from './getBrowserPage.ts' export const pageViewPortDefaults: Viewport = { ...defaultViewportSize, diff --git a/src/modules/metaServer/lib/page/usePage/useSpaPage.ts b/src/modules/metaServer/lib/page/usePage/useSpaPage.ts index 0fa4d00..5c0bae9 100644 --- a/src/modules/metaServer/lib/page/usePage/useSpaPage.ts +++ b/src/modules/metaServer/lib/page/usePage/useSpaPage.ts @@ -2,10 +2,10 @@ import { Mutex } from 'async-mutex' import { Browser, Page, Viewport, WaitForOptions } from 'puppeteer' -import { defaultViewportSize, useBrowser } from '../../browser/index.js' -import { PageRenderingOptions } from '../PageRenderingOptions.js' -import { timeout, waitUntil } from './defaults.js' -import { getBrowserPage } from './getBrowserPage.js' +import { defaultViewportSize, useBrowser } from '../../browser/index.ts' +import { PageRenderingOptions } from '../PageRenderingOptions.ts' +import { timeout, waitUntil } from './defaults.ts' +import { getBrowserPage } from './getBrowserPage.ts' const viewPortDefaults: Viewport = { ...defaultViewportSize, diff --git a/src/modules/metaServer/lib/path/getAdjustedPath.ts b/src/modules/metaServer/lib/path/getAdjustedPath.ts index b284682..95190f3 100644 --- a/src/modules/metaServer/lib/path/getAdjustedPath.ts +++ b/src/modules/metaServer/lib/path/getAdjustedPath.ts @@ -2,7 +2,7 @@ import Path from 'node:path' import { Request } from 'express' -import { isKnownFileExtension } from '../file/index.js' +import { isKnownFileExtension } from '../file/index.ts' export const getAdjustedPath = (req: Request): string => { if (isKnownFileExtension(req.path)) return req.path diff --git a/src/modules/metaServer/lib/path/isHtmlLike.ts b/src/modules/metaServer/lib/path/isHtmlLike.ts index f37c7aa..465e8e6 100644 --- a/src/modules/metaServer/lib/path/isHtmlLike.ts +++ b/src/modules/metaServer/lib/path/isHtmlLike.ts @@ -2,7 +2,7 @@ import Path from 'node:path' import { Request } from 'express' -import { isKnownFileExtension } from '../file/index.js' +import { isKnownFileExtension } from '../file/index.ts' /** * Returns true request path could be referring diff --git a/src/modules/metaServer/lib/path/routeMatcher/createGlobMatcher.ts b/src/modules/metaServer/lib/path/routeMatcher/createGlobMatcher.ts index 6a96e8d..b185f59 100644 --- a/src/modules/metaServer/lib/path/routeMatcher/createGlobMatcher.ts +++ b/src/modules/metaServer/lib/path/routeMatcher/createGlobMatcher.ts @@ -1,6 +1,6 @@ import { minimatch } from 'minimatch' -import { RouteMatcher } from './RouteMatcher.js' +import { RouteMatcher } from './RouteMatcher.ts' /** * Higher order function which creates route matchers diff --git a/src/modules/metaServer/lib/path/routeMatcher/createRegexMatcher.ts b/src/modules/metaServer/lib/path/routeMatcher/createRegexMatcher.ts index 9750064..5751d34 100644 --- a/src/modules/metaServer/lib/path/routeMatcher/createRegexMatcher.ts +++ b/src/modules/metaServer/lib/path/routeMatcher/createRegexMatcher.ts @@ -1,7 +1,7 @@ import { assertEx } from '@xylabs/assert' import { makeRe, MMRegExp } from 'minimatch' -import { RouteMatcher } from './RouteMatcher.js' +import { RouteMatcher } from './RouteMatcher.ts' /** * Higher order function which creates precompiled RegEx route matchers diff --git a/src/modules/metaServer/lib/path/spec/isHtmlLike.spec.ts b/src/modules/metaServer/lib/path/spec/isHtmlLike.spec.ts index f5e3eec..e3f5454 100644 --- a/src/modules/metaServer/lib/path/spec/isHtmlLike.spec.ts +++ b/src/modules/metaServer/lib/path/spec/isHtmlLike.spec.ts @@ -1,6 +1,6 @@ import { Request } from 'express' -import { isHtmlLike } from '../isHtmlLike.js' +import { isHtmlLike } from '../isHtmlLike.ts' const getRequestForUri = (uri: string) => { return { diff --git a/src/modules/metaServer/lib/repository/file/FileRepository.ts b/src/modules/metaServer/lib/repository/file/FileRepository.ts index bb8f7d5..a392bb7 100644 --- a/src/modules/metaServer/lib/repository/file/FileRepository.ts +++ b/src/modules/metaServer/lib/repository/file/FileRepository.ts @@ -1,4 +1,4 @@ -import { RepositoryFile } from './RepositoryFile.js' +import { RepositoryFile } from './RepositoryFile.ts' /** * A repository for storing files. diff --git a/src/modules/metaServer/lib/repository/file/getFileRepository.ts b/src/modules/metaServer/lib/repository/file/getFileRepository.ts index bb4151a..de72196 100644 --- a/src/modules/metaServer/lib/repository/file/getFileRepository.ts +++ b/src/modules/metaServer/lib/repository/file/getFileRepository.ts @@ -1,7 +1,7 @@ -import { getAwsS3ClientConfig, getBucket, hasBucket, tryGetBucket } from '../../aws/index.js' -import { FileRepository } from './FileRepository.js' -import { MemoryFileRepository } from './memory/index.js' -import { S3FileRepository } from './s3/index.js' +import { getAwsS3ClientConfig, getBucket, hasBucket, tryGetBucket } from '../../aws/index.ts' +import { FileRepository } from './FileRepository.ts' +import { MemoryFileRepository } from './memory/index.ts' +import { S3FileRepository } from './s3/index.ts' let repository: FileRepository | undefined diff --git a/src/modules/metaServer/lib/repository/file/memory/MemoryFileRepository.ts b/src/modules/metaServer/lib/repository/file/memory/MemoryFileRepository.ts index d02cd5f..e435419 100644 --- a/src/modules/metaServer/lib/repository/file/memory/MemoryFileRepository.ts +++ b/src/modules/metaServer/lib/repository/file/memory/MemoryFileRepository.ts @@ -1,7 +1,7 @@ import { LRUCache } from 'lru-cache' -import { FileRepository } from '../FileRepository.js' -import { RepositoryFile } from '../RepositoryFile.js' +import { FileRepository } from '../FileRepository.ts' +import { RepositoryFile } from '../RepositoryFile.ts' export class MemoryFileRepository implements FileRepository { protected files = new LRUCache({ max: 1000 }) diff --git a/src/modules/metaServer/lib/repository/file/memory/spec/MemoryFileRepository.spec.ts b/src/modules/metaServer/lib/repository/file/memory/spec/MemoryFileRepository.spec.ts index 5f80b46..a0cf057 100644 --- a/src/modules/metaServer/lib/repository/file/memory/spec/MemoryFileRepository.spec.ts +++ b/src/modules/metaServer/lib/repository/file/memory/spec/MemoryFileRepository.spec.ts @@ -1,7 +1,7 @@ import { readFile } from 'node:fs/promises' import Path from 'node:path' -import { MemoryFileRepository } from '../MemoryFileRepository.js' +import { MemoryFileRepository } from '../MemoryFileRepository.ts' describe('MemoryFileRepository', () => { let sut: MemoryFileRepository diff --git a/src/modules/metaServer/lib/repository/file/s3/S3FileRepository.ts b/src/modules/metaServer/lib/repository/file/s3/S3FileRepository.ts index 2375f75..fa6f234 100644 --- a/src/modules/metaServer/lib/repository/file/s3/S3FileRepository.ts +++ b/src/modules/metaServer/lib/repository/file/s3/S3FileRepository.ts @@ -1,9 +1,9 @@ import { S3ClientConfig } from '@aws-sdk/client-s3' -import { S3Store } from '../../../aws/index.js' -import { getContentType } from '../../../file/index.js' -import { FileRepository } from '../FileRepository.js' -import { RepositoryFile } from '../RepositoryFile.js' +import { S3Store } from '../../../aws/index.ts' +import { getContentType } from '../../../file/index.ts' +import { FileRepository } from '../FileRepository.ts' +import { RepositoryFile } from '../RepositoryFile.ts' export class S3FileRepository implements FileRepository { private store: S3Store diff --git a/src/modules/metaServer/lib/repository/file/s3/spec/S3FileRepository.spec.ts b/src/modules/metaServer/lib/repository/file/s3/spec/S3FileRepository.spec.ts index d87b672..01e3af5 100644 --- a/src/modules/metaServer/lib/repository/file/s3/spec/S3FileRepository.spec.ts +++ b/src/modules/metaServer/lib/repository/file/s3/spec/S3FileRepository.spec.ts @@ -4,8 +4,8 @@ import Path from 'node:path' import { S3ClientConfig } from '@aws-sdk/client-s3' import { describeIf } from '@xylabs/jest-helpers' -import { getAwsS3ClientConfig, getDefaultTestBucket, hasBucket } from '../../../../aws/index.js' -import { S3FileRepository } from '../S3FileRepository.js' +import { getAwsS3ClientConfig, getDefaultTestBucket, hasBucket } from '../../../../aws/index.ts' +import { S3FileRepository } from '../S3FileRepository.ts' describeIf(hasBucket())('S3FileRepository', () => { let config: S3ClientConfig diff --git a/src/modules/metaServer/lib/socialMedia/facebook/auth/canGetAppAccessToken.ts b/src/modules/metaServer/lib/socialMedia/facebook/auth/canGetAppAccessToken.ts index 70c4a40..1ff9fbd 100644 --- a/src/modules/metaServer/lib/socialMedia/facebook/auth/canGetAppAccessToken.ts +++ b/src/modules/metaServer/lib/socialMedia/facebook/auth/canGetAppAccessToken.ts @@ -1,4 +1,4 @@ -import { tryGetAuthInfo } from './tryGetAuthInfo.js' +import { tryGetAuthInfo } from './tryGetAuthInfo.ts' /** * Obtains an access token for the app. diff --git a/src/modules/metaServer/lib/socialMedia/facebook/auth/spec/tryGetAppAccessToken.spec.ts b/src/modules/metaServer/lib/socialMedia/facebook/auth/spec/tryGetAppAccessToken.spec.ts index 72c9581..bcf463c 100644 --- a/src/modules/metaServer/lib/socialMedia/facebook/auth/spec/tryGetAppAccessToken.spec.ts +++ b/src/modules/metaServer/lib/socialMedia/facebook/auth/spec/tryGetAppAccessToken.spec.ts @@ -1,7 +1,7 @@ import { describeIf } from '@xylabs/jest-helpers' -import { canGetAppAccessToken } from '../canGetAppAccessToken.js' -import { tryGetAppAccessToken } from '../tryGetAppAccessToken.js' +import { canGetAppAccessToken } from '../canGetAppAccessToken.ts' +import { tryGetAppAccessToken } from '../tryGetAppAccessToken.ts' describeIf(canGetAppAccessToken())('tryGetAppAccessToken', () => { it('Returns access_token', async () => { diff --git a/src/modules/metaServer/lib/socialMedia/facebook/auth/tryGetAppAccessToken.ts b/src/modules/metaServer/lib/socialMedia/facebook/auth/tryGetAppAccessToken.ts index 296983f..4d7570f 100644 --- a/src/modules/metaServer/lib/socialMedia/facebook/auth/tryGetAppAccessToken.ts +++ b/src/modules/metaServer/lib/socialMedia/facebook/auth/tryGetAppAccessToken.ts @@ -1,6 +1,6 @@ import { axios } from '@xyo-network/axios' -import { tryGetAuthInfo } from './tryGetAuthInfo.js' +import { tryGetAuthInfo } from './tryGetAuthInfo.ts' const tokenUrl = 'https://graph.facebook.com/oauth/access_token' const grant_type = 'client_credentials' diff --git a/src/modules/metaServer/lib/socialMedia/facebook/auth/tryGetAuthInfo.ts b/src/modules/metaServer/lib/socialMedia/facebook/auth/tryGetAuthInfo.ts index 0edbd7d..80b92ef 100644 --- a/src/modules/metaServer/lib/socialMedia/facebook/auth/tryGetAuthInfo.ts +++ b/src/modules/metaServer/lib/socialMedia/facebook/auth/tryGetAuthInfo.ts @@ -1,4 +1,4 @@ -import { tryGetFacebookAppId, tryGetFacebookAppSecret } from '../config/index.js' +import { tryGetFacebookAppId, tryGetFacebookAppSecret } from '../config/index.ts' export const tryGetAuthInfo = () => { const client_id = tryGetFacebookAppId() diff --git a/src/modules/metaServer/lib/socialMedia/facebook/config/appId.ts b/src/modules/metaServer/lib/socialMedia/facebook/config/appId.ts index 8ff53a8..eec9766 100644 --- a/src/modules/metaServer/lib/socialMedia/facebook/config/appId.ts +++ b/src/modules/metaServer/lib/socialMedia/facebook/config/appId.ts @@ -1,3 +1,3 @@ -import { generateEnvVarHelpers } from '../../../env/index.js' +import { generateEnvVarHelpers } from '../../../env/index.ts' export const { hasEnvVar: hasFacebookAppId, tryGetEnvVar: tryGetFacebookAppId, getEnvVar: getFacebookAppId } = generateEnvVarHelpers('FB_APP_ID') diff --git a/src/modules/metaServer/lib/socialMedia/facebook/config/appSecret.ts b/src/modules/metaServer/lib/socialMedia/facebook/config/appSecret.ts index 4af1d00..27effe4 100644 --- a/src/modules/metaServer/lib/socialMedia/facebook/config/appSecret.ts +++ b/src/modules/metaServer/lib/socialMedia/facebook/config/appSecret.ts @@ -1,4 +1,4 @@ -import { generateEnvVarHelpers } from '../../../env/index.js' +import { generateEnvVarHelpers } from '../../../env/index.ts' export const { hasEnvVar: hasFacebookAppSecret, diff --git a/src/modules/metaServer/lib/socialMedia/facebook/share/preCacheFacebookShare.ts b/src/modules/metaServer/lib/socialMedia/facebook/share/preCacheFacebookShare.ts index 5f411ef..2ab6989 100644 --- a/src/modules/metaServer/lib/socialMedia/facebook/share/preCacheFacebookShare.ts +++ b/src/modules/metaServer/lib/socialMedia/facebook/share/preCacheFacebookShare.ts @@ -1,6 +1,6 @@ import { axios } from '@xyo-network/axios' -import { tryGetAppAccessToken } from '../auth/index.js' +import { tryGetAppAccessToken } from '../auth/index.ts' const openApiUrl = 'https://graph.facebook.com/' diff --git a/src/modules/metaServer/lib/socialMedia/facebook/share/spec/preCacheFacebookShare.spec.ts b/src/modules/metaServer/lib/socialMedia/facebook/share/spec/preCacheFacebookShare.spec.ts index bb212a1..ed492cc 100644 --- a/src/modules/metaServer/lib/socialMedia/facebook/share/spec/preCacheFacebookShare.spec.ts +++ b/src/modules/metaServer/lib/socialMedia/facebook/share/spec/preCacheFacebookShare.spec.ts @@ -1,7 +1,7 @@ import { describeIf } from '@xylabs/jest-helpers' -import { canGetAppAccessToken } from '../../auth/index.js' -import { preCacheFacebookShare } from '../preCacheFacebookShare.js' +import { canGetAppAccessToken } from '../../auth/index.ts' +import { preCacheFacebookShare } from '../preCacheFacebookShare.ts' describeIf(canGetAppAccessToken())('preCacheFacebookShare', () => { const urls = ['https://www.youtube.com/watch?v=Kauv7MVPcsA'] diff --git a/src/modules/metaServer/lib/uri/getHashInfoFromUri.ts b/src/modules/metaServer/lib/uri/getHashInfoFromUri.ts index 1a08983..8c68cdf 100644 --- a/src/modules/metaServer/lib/uri/getHashInfoFromUri.ts +++ b/src/modules/metaServer/lib/uri/getHashInfoFromUri.ts @@ -1,4 +1,4 @@ -import { HashInfo } from '../../types/index.js' +import { HashInfo } from '../../types/index.ts' // TODO: Something more intelligent than just same length/characters const pattern = /(?[\da-f]{64})/ diff --git a/src/modules/metaServer/lib/uri/getUriBehindProxy.ts b/src/modules/metaServer/lib/uri/getUriBehindProxy.ts index d6fb56e..66d0896 100644 --- a/src/modules/metaServer/lib/uri/getUriBehindProxy.ts +++ b/src/modules/metaServer/lib/uri/getUriBehindProxy.ts @@ -1,6 +1,6 @@ import { Request } from 'express' -import { isLocalhost } from '../domain/index.js' +import { isLocalhost } from '../domain/index.ts' /** * Since we're often operating behind both CloudFront & an ALB, within diff --git a/src/modules/metaServer/lib/uri/spec/getDomainFromUri.spec.ts b/src/modules/metaServer/lib/uri/spec/getDomainFromUri.spec.ts index 2c70141..d1d1ac1 100644 --- a/src/modules/metaServer/lib/uri/spec/getDomainFromUri.spec.ts +++ b/src/modules/metaServer/lib/uri/spec/getDomainFromUri.spec.ts @@ -1,4 +1,4 @@ -import { getDomainFromUri } from '../getDomainFromUri.js' +import { getDomainFromUri } from '../getDomainFromUri.ts' const validUris = [ ['https://www.google.com/search/foo', 'https://www.google.com'], diff --git a/src/modules/metaServer/lib/uri/spec/getHashInfoFromUri.spec.ts b/src/modules/metaServer/lib/uri/spec/getHashInfoFromUri.spec.ts index 3bdf3dc..dc20945 100644 --- a/src/modules/metaServer/lib/uri/spec/getHashInfoFromUri.spec.ts +++ b/src/modules/metaServer/lib/uri/spec/getHashInfoFromUri.spec.ts @@ -1,4 +1,4 @@ -import { getHashInfoFromUri } from '../getHashInfoFromUri.js' +import { getHashInfoFromUri } from '../getHashInfoFromUri.ts' describe('getHashInfoFromUri', () => { describe('with valid URI', () => { diff --git a/src/modules/metaServer/lib/uri/spec/getUriBehindProxy.spec.ts b/src/modules/metaServer/lib/uri/spec/getUriBehindProxy.spec.ts index 2c1a2e9..3baab5f 100644 --- a/src/modules/metaServer/lib/uri/spec/getUriBehindProxy.spec.ts +++ b/src/modules/metaServer/lib/uri/spec/getUriBehindProxy.spec.ts @@ -1,6 +1,6 @@ import { Request } from 'express' -import { getUriBehindProxy } from '../getUriBehindProxy.js' +import { getUriBehindProxy } from '../getUriBehindProxy.ts' const getMockRequestForHost = (host: string): Request => { return { diff --git a/src/modules/metaServer/lib/uri/spec/join.spec.ts b/src/modules/metaServer/lib/uri/spec/join.spec.ts index c380101..c2b1ba0 100644 --- a/src/modules/metaServer/lib/uri/spec/join.spec.ts +++ b/src/modules/metaServer/lib/uri/spec/join.spec.ts @@ -1,4 +1,4 @@ -import { join } from '../join.js' +import { join } from '../join.ts' describe('join', () => { const cases: [string[], string][] = [ diff --git a/src/modules/metaServer/lib/uri/spec/queryParams.spec.ts b/src/modules/metaServer/lib/uri/spec/queryParams.spec.ts index 375bb2c..9b35189 100644 --- a/src/modules/metaServer/lib/uri/spec/queryParams.spec.ts +++ b/src/modules/metaServer/lib/uri/spec/queryParams.spec.ts @@ -1,4 +1,4 @@ -import { addQueryParam, addQueryParams, removeQueryParam, removeQueryParams } from '../queryParams.js' +import { addQueryParam, addQueryParams, removeQueryParam, removeQueryParams } from '../queryParams.ts' describe('Query Parameters Utility', () => { describe('addQueryParam', () => { diff --git a/src/modules/metaServer/middleware/metaCache/MetaCacheLocals.ts b/src/modules/metaServer/middleware/metaCache/MetaCacheLocals.ts index de240a2..4840183 100644 --- a/src/modules/metaServer/middleware/metaCache/MetaCacheLocals.ts +++ b/src/modules/metaServer/middleware/metaCache/MetaCacheLocals.ts @@ -1,6 +1,6 @@ import { NoLocals } from '@xylabs/sdk-api-express-ecs' -import { MetaCache } from './MetaCache.js' +import { MetaCache } from './MetaCache.ts' export type MetaCacheProperties = { /** diff --git a/src/modules/metaServer/middleware/metaCache/SimpleMetaCache.ts b/src/modules/metaServer/middleware/metaCache/SimpleMetaCache.ts index d2dd3e3..bbda5b8 100644 --- a/src/modules/metaServer/middleware/metaCache/SimpleMetaCache.ts +++ b/src/modules/metaServer/middleware/metaCache/SimpleMetaCache.ts @@ -1,7 +1,7 @@ import { mergeDocumentHead, Meta, metaBuilder } from '@xyo-network/sdk-meta' import { LRUCache } from 'lru-cache' -import { MetaCache } from './MetaCache.js' +import { MetaCache } from './MetaCache.ts' const defaultHtml = ` diff --git a/src/modules/metaServer/middleware/metaCache/middleware.ts b/src/modules/metaServer/middleware/metaCache/middleware.ts index 8fe5761..7f4a541 100644 --- a/src/modules/metaServer/middleware/metaCache/middleware.ts +++ b/src/modules/metaServer/middleware/metaCache/middleware.ts @@ -1,9 +1,9 @@ import { asyncHandler, Empty, NoReqParams } from '@xylabs/sdk-api-express-ecs' import { RequestHandler } from 'express' -import { MetaCacheLocals } from './MetaCacheLocals.js' -import { MetaCacheQueryParams } from './MetaCacheQueryParams.js' -import { SimpleMetaCache } from './SimpleMetaCache.js' +import { MetaCacheLocals } from './MetaCacheLocals.ts' +import { MetaCacheQueryParams } from './MetaCacheQueryParams.ts' +import { SimpleMetaCache } from './SimpleMetaCache.ts' export const metaCache = (): RequestHandler => { const cache = new SimpleMetaCache() diff --git a/src/modules/metaServer/middleware/metaCache/spec/SimpleMetaCache.spec.ts b/src/modules/metaServer/middleware/metaCache/spec/SimpleMetaCache.spec.ts index 3629420..99ef17d 100644 --- a/src/modules/metaServer/middleware/metaCache/spec/SimpleMetaCache.spec.ts +++ b/src/modules/metaServer/middleware/metaCache/spec/SimpleMetaCache.spec.ts @@ -1,4 +1,4 @@ -import { SimpleMetaCache } from '../SimpleMetaCache.js' +import { SimpleMetaCache } from '../SimpleMetaCache.ts' const path1 = '/providers/netflix' const path2 = '/providers/hulu' diff --git a/src/modules/metaServer/server/spec/index.spec.ts b/src/modules/metaServer/server/spec/index.spec.ts index 5b68ddb..49db9f4 100644 --- a/src/modules/metaServer/server/spec/index.spec.ts +++ b/src/modules/metaServer/server/spec/index.spec.ts @@ -1,4 +1,4 @@ -import { getServer } from '../../spec/index.js' +import { getServer } from '../../spec/index.ts' describe('Server', () => { it('starts up', async () => { diff --git a/src/modules/metaServer/types/PayloadInfo.ts b/src/modules/metaServer/types/PayloadInfo.ts index cc18989..c1a7bca 100644 --- a/src/modules/metaServer/types/PayloadInfo.ts +++ b/src/modules/metaServer/types/PayloadInfo.ts @@ -1,4 +1,4 @@ -import { HashInfo } from './HashInfo.js' +import { HashInfo } from './HashInfo.ts' export interface PayloadInfo extends HashInfo { apiDomain: string