@creator.co/wapi 1.7.1 → 1.7.2-alpha1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. package/.eslintrc.cjs +4 -2
  2. package/dist/index.d.ts +14 -14
  3. package/dist/index.js +14 -14
  4. package/dist/index.js.map +1 -1
  5. package/dist/package-lock.json +2676 -454
  6. package/dist/package.json +2 -1
  7. package/dist/src/API/Request.d.ts +1 -1
  8. package/dist/src/API/Request.js +1 -1
  9. package/dist/src/API/Request.js.map +1 -1
  10. package/dist/src/API/Response.d.ts +1 -1
  11. package/dist/src/API/Response.js +1 -1
  12. package/dist/src/API/Response.js.map +1 -1
  13. package/dist/src/BaseEvent/EventProcessor.d.ts +2 -2
  14. package/dist/src/BaseEvent/EventProcessor.js +3 -3
  15. package/dist/src/BaseEvent/EventProcessor.js.map +1 -1
  16. package/dist/src/BaseEvent/Process.d.ts +3 -3
  17. package/dist/src/BaseEvent/Process.js +2 -2
  18. package/dist/src/BaseEvent/Process.js.map +1 -1
  19. package/dist/src/BaseEvent/Transaction.d.ts +5 -5
  20. package/dist/src/BaseEvent/Transaction.js +6 -6
  21. package/dist/src/BaseEvent/Transaction.js.map +1 -1
  22. package/dist/src/Cache/Redis.d.ts +1 -1
  23. package/dist/src/Cache/Redis.js +1 -1
  24. package/dist/src/Cache/Redis.js.map +1 -1
  25. package/dist/src/Cache/types.d.ts +1 -1
  26. package/dist/src/Config/Configuration.js +1 -1
  27. package/dist/src/Config/Configuration.js.map +1 -1
  28. package/dist/src/Database/Database.d.ts +2 -2
  29. package/dist/src/Database/DatabaseManager.d.ts +4 -4
  30. package/dist/src/Database/DatabaseManager.js +3 -3
  31. package/dist/src/Database/DatabaseManager.js.map +1 -1
  32. package/dist/src/Database/DatabaseTransaction.d.ts +1 -1
  33. package/dist/src/Database/index.d.ts +10 -10
  34. package/dist/src/Database/index.js +6 -6
  35. package/dist/src/Database/index.js.map +1 -1
  36. package/dist/src/Database/integrations/knex/KnexDatabase.d.ts +3 -3
  37. package/dist/src/Database/integrations/knex/KnexDatabase.js +2 -2
  38. package/dist/src/Database/integrations/knex/KnexDatabase.js.map +1 -1
  39. package/dist/src/Database/integrations/knex/KnexTransaction.d.ts +3 -3
  40. package/dist/src/Database/integrations/knex/KnexTransaction.js +1 -1
  41. package/dist/src/Database/integrations/knex/KnexTransaction.js.map +1 -1
  42. package/dist/src/Database/integrations/kysely/KyselyDatabase.d.ts +3 -3
  43. package/dist/src/Database/integrations/kysely/KyselyDatabase.js +2 -2
  44. package/dist/src/Database/integrations/kysely/KyselyDatabase.js.map +1 -1
  45. package/dist/src/Database/integrations/kysely/KyselyTransaction.d.ts +3 -3
  46. package/dist/src/Database/integrations/kysely/KyselyTransaction.js +1 -1
  47. package/dist/src/Database/integrations/kysely/KyselyTransaction.js.map +1 -1
  48. package/dist/src/Database/integrations/pgsql/PostgresDatabase.d.ts +3 -3
  49. package/dist/src/Database/integrations/pgsql/PostgresDatabase.js +2 -2
  50. package/dist/src/Database/integrations/pgsql/PostgresDatabase.js.map +1 -1
  51. package/dist/src/Database/integrations/pgsql/PostgresTransaction.d.ts +3 -3
  52. package/dist/src/Database/integrations/pgsql/PostgresTransaction.js +1 -1
  53. package/dist/src/Database/integrations/pgsql/PostgresTransaction.js.map +1 -1
  54. package/dist/src/Database/types.d.ts +5 -5
  55. package/dist/src/Globals.js +1 -1
  56. package/dist/src/Globals.js.map +1 -1
  57. package/dist/src/Logger/Logger.js +1 -1
  58. package/dist/src/Logger/Logger.js.map +1 -1
  59. package/dist/src/Server/RouteResolver.d.ts +2 -2
  60. package/dist/src/Server/Router.d.ts +3 -3
  61. package/dist/src/Server/Router.js +3 -3
  62. package/dist/src/Server/Router.js.map +1 -1
  63. package/dist/src/Server/lib/ContainerServer.d.ts +3 -3
  64. package/dist/src/Server/lib/ContainerServer.js +2 -2
  65. package/dist/src/Server/lib/ContainerServer.js.map +1 -1
  66. package/dist/src/Server/lib/Server.d.ts +2 -2
  67. package/dist/src/Server/lib/Server.js +4 -4
  68. package/dist/src/Server/lib/Server.js.map +1 -1
  69. package/dist/src/Server/lib/container/GenericHandler.d.ts +1 -1
  70. package/dist/src/Server/lib/container/GenericHandler.js +3 -3
  71. package/dist/src/Server/lib/container/GenericHandler.js.map +1 -1
  72. package/dist/src/Server/lib/container/GenericHandlerEvent.d.ts +1 -1
  73. package/dist/src/Server/lib/container/GenericHandlerEvent.js +2 -2
  74. package/dist/src/Server/lib/container/GenericHandlerEvent.js.map +1 -1
  75. package/dist/src/Server/lib/container/Proxy.d.ts +2 -2
  76. package/dist/src/Server/lib/container/Proxy.js +4 -4
  77. package/dist/src/Server/lib/container/Proxy.js.map +1 -1
  78. package/dist/src/Validation/Validator.d.ts +1 -1
  79. package/dist/src/Validation/Validator.js +2 -2
  80. package/dist/src/Validation/Validator.js.map +1 -1
  81. package/index.ts +14 -14
  82. package/jest.config.ts +5 -1
  83. package/jest.smoke.config.ts +0 -1
  84. package/package.json +2 -1
  85. package/src/API/Request.ts +2 -2
  86. package/src/API/Response.ts +2 -2
  87. package/src/BaseEvent/EventProcessor.ts +3 -3
  88. package/src/BaseEvent/Process.ts +3 -3
  89. package/src/BaseEvent/Transaction.ts +8 -8
  90. package/src/Cache/Redis.ts +2 -2
  91. package/src/Cache/types.ts +1 -1
  92. package/src/Config/Configuration.ts +1 -1
  93. package/src/Database/Database.ts +2 -2
  94. package/src/Database/DatabaseManager.ts +4 -4
  95. package/src/Database/DatabaseTransaction.ts +1 -1
  96. package/src/Database/index.ts +10 -10
  97. package/src/Database/integrations/knex/KnexDatabase.ts +3 -3
  98. package/src/Database/integrations/knex/KnexTransaction.ts +3 -3
  99. package/src/Database/integrations/kysely/KyselyDatabase.ts +3 -3
  100. package/src/Database/integrations/kysely/KyselyTransaction.ts +3 -3
  101. package/src/Database/integrations/pgsql/PostgresDatabase.ts +3 -3
  102. package/src/Database/integrations/pgsql/PostgresTransaction.ts +3 -3
  103. package/src/Database/types.ts +5 -5
  104. package/src/Globals.ts +1 -1
  105. package/src/Logger/Logger.ts +1 -1
  106. package/src/Server/RouteResolver.ts +2 -2
  107. package/src/Server/Router.ts +6 -6
  108. package/src/Server/lib/ContainerServer.ts +3 -3
  109. package/src/Server/lib/Server.ts +6 -6
  110. package/src/Server/lib/container/GenericHandler.ts +4 -4
  111. package/src/Server/lib/container/GenericHandlerEvent.ts +3 -3
  112. package/src/Server/lib/container/Proxy.ts +6 -6
  113. package/src/Validation/Validator.ts +2 -2
  114. package/tests/API/Request.test.ts +2 -2
  115. package/tests/API/Response.test.ts +4 -4
  116. package/tests/API/Utils.test.ts +1 -1
  117. package/tests/BaseEvent/EventProcessor.test.ts +4 -4
  118. package/tests/BaseEvent/Process.test.ts +2 -2
  119. package/tests/BaseEvent/Transaction.test.ts +5 -5
  120. package/tests/Cache/Redis-client.test.ts +1 -1
  121. package/tests/Cache/Redis-cluster.test.ts +1 -1
  122. package/tests/Config/Config.test.ts +2 -2
  123. package/tests/Config/EnvironmentVar.test.ts +1 -1
  124. package/tests/Crypto/Crypto.test.ts +1 -1
  125. package/tests/Crypto/JWT.test.ts +2 -2
  126. package/tests/Database/DatabaseManager.test.ts +2 -2
  127. package/tests/Database/integrations/knex/KnexDatabase.test.ts +2 -2
  128. package/tests/Database/integrations/knex/KnexTransaction.test.ts +3 -3
  129. package/tests/Database/integrations/kysely/KyselyDatabase.test.ts +2 -2
  130. package/tests/Database/integrations/kysely/KyselyTransaction.test.ts +3 -3
  131. package/tests/Database/integrations/pg/PostgresDatabase.test.ts +2 -2
  132. package/tests/Database/integrations/pg/PostgresTransaction.test.ts +3 -3
  133. package/tests/Logger/Logger.test.ts +1 -1
  134. package/tests/Mailer/Mailer.test.ts +1 -1
  135. package/tests/Publisher/Publisher.test.ts +1 -1
  136. package/tests/Server/RouteResolver.test.ts +3 -3
  137. package/tests/Server/Router.test.ts +3 -3
  138. package/tests/Server/lib/ContainerServer.test.ts +5 -5
  139. package/tests/Server/lib/Server.test.ts +1 -1
  140. package/tests/Server/lib/container/GenericHandler.test.ts +2 -2
  141. package/tests/Server/lib/container/GenericHandlerEvent.test.ts +2 -2
  142. package/tests/Server/lib/container/HealthHandler.test.ts +1 -1
  143. package/tests/Server/lib/container/Proxy.test.ts +3 -3
  144. package/tests/Server/lib/container/Utils.test.ts +1 -1
  145. package/tests/Test.utils.ts +2 -2
  146. package/tests/Validation/Validator.test.ts +4 -4
@@ -1,8 +1,8 @@
1
1
  import { Knex } from 'knex'
2
2
 
3
- import { KnexDatabase } from './KnexDatabase'
4
- import { Database } from '../../Database'
5
- import { DatabaseTransaction } from '../../DatabaseTransaction'
3
+ import { KnexDatabase } from './KnexDatabase.js'
4
+ import { Database } from '../../Database.js'
5
+ import { DatabaseTransaction } from '../../DatabaseTransaction.js'
6
6
 
7
7
  /**
8
8
  * Represents a Knex transaction, combining the functionality of KnexTransactionImpl
@@ -1,9 +1,9 @@
1
1
  import { CamelCasePlugin, Kysely, PostgresDialect } from 'kysely'
2
2
  import * as pg from 'pg'
3
3
 
4
- import { KyselyTransaction, KyselyTransactionImpl } from './KyselyTransaction'
5
- import { Database } from '../../Database'
6
- import type { DbBaseConfig, DbConfig } from '../../types'
4
+ import { KyselyTransaction, KyselyTransactionImpl } from './KyselyTransaction.js'
5
+ import { Database } from '../../Database.js'
6
+ import type { DbBaseConfig, DbConfig } from '../../types.js'
7
7
 
8
8
  /**
9
9
  * Represents a database connection using the Kysely library with support for transactions.
@@ -1,8 +1,8 @@
1
1
  import { Kysely, Transaction } from 'kysely'
2
2
 
3
- import { KyselyDatabase } from './KyselyDatabase'
4
- import { Database } from '../../Database'
5
- import { DatabaseTransaction } from '../../DatabaseTransaction'
3
+ import { KyselyDatabase } from './KyselyDatabase.js'
4
+ import { Database } from '../../Database.js'
5
+ import { DatabaseTransaction } from '../../DatabaseTransaction.js'
6
6
 
7
7
  /**
8
8
  * Represents a transaction for querying a database with a specific schema.
@@ -1,8 +1,8 @@
1
1
  import * as pg from 'pg'
2
2
 
3
- import { PostgresTransaction, PostgresTransactionImpl } from './PostgresTransaction'
4
- import { Database } from '../../Database'
5
- import type { DbBaseConfig, DbConfig } from '../../types'
3
+ import { PostgresTransaction, PostgresTransactionImpl } from './PostgresTransaction.js'
4
+ import { Database } from '../../Database.js'
5
+ import type { DbBaseConfig, DbConfig } from '../../types.js'
6
6
 
7
7
  /**
8
8
  * Represents a Postgres database connection that extends the Database class.
@@ -1,8 +1,8 @@
1
1
  import * as pg from 'pg'
2
2
 
3
- import { PostgresDatabase } from './PostgresDatabase'
4
- import { Database } from '../../Database'
5
- import { DatabaseTransaction } from '../../DatabaseTransaction'
3
+ import { PostgresDatabase } from './PostgresDatabase.js'
4
+ import { Database } from '../../Database.js'
5
+ import { DatabaseTransaction } from '../../DatabaseTransaction.js'
6
6
 
7
7
  /**
8
8
  * A type alias representing a Postgres transaction. It extends the `PostgresTransactionImpl`
@@ -1,8 +1,8 @@
1
- import { Database } from './Database'
2
- import { DATABASES } from './DatabaseManager'
3
- import { KnexDatabase } from './integrations/knex/KnexDatabase'
4
- import { KyselyDatabase } from './integrations/kysely/KyselyDatabase'
5
- import { PostgresDatabase } from './integrations/pgsql/PostgresDatabase'
1
+ import { Database } from './Database.js'
2
+ import { DATABASES } from './DatabaseManager.js'
3
+ import { KnexDatabase } from './integrations/knex/KnexDatabase.js'
4
+ import { KyselyDatabase } from './integrations/kysely/KyselyDatabase.js'
5
+ import { PostgresDatabase } from './integrations/pgsql/PostgresDatabase.js'
6
6
 
7
7
  /**
8
8
  * Represents the possible types of databases available in the system.
package/src/Globals.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import dotenv from 'dotenv'
2
2
 
3
- import Utils from './Util/Utils'
3
+ import Utils from './Util/Utils.js'
4
4
 
5
5
  // important for dev env to load .env file
6
6
  dotenv.config()
@@ -2,7 +2,7 @@ import abind from 'abind'
2
2
  import stringify from 'json-stringify-safe'
3
3
  import stackTrace from 'stack-trace'
4
4
 
5
- import Utils from '../Util/Utils'
5
+ import Utils from '../Util/Utils.js'
6
6
 
7
7
  /**
8
8
  * Enumeration of log levels.
@@ -1,5 +1,5 @@
1
- import { AnyRoute, RouterConfig } from './Router'
2
- import { HttpMethod } from '../API/Request'
1
+ import { AnyRoute, RouterConfig } from './Router.js'
2
+ import { HttpMethod } from '../API/Request.js'
3
3
 
4
4
  /**
5
5
  * Represents a collection of routes that can be added and resolved.
@@ -3,16 +3,16 @@ import { Server as HTTPServer } from 'http'
3
3
  import express from 'express'
4
4
  import { z } from 'zod'
5
5
 
6
- import ContainerServer from './lib/ContainerServer'
7
- import Server from './lib/Server'
8
- import { HttpMethod } from '../API/Request'
9
- import { ResponseErrorType } from '../API/Response'
6
+ import ContainerServer from './lib/ContainerServer.js'
7
+ import Server from './lib/Server.js'
8
+ import { HttpMethod } from '../API/Request.js'
9
+ import { ResponseErrorType } from '../API/Response.js'
10
10
  import Transaction, {
11
11
  TransactionConfig,
12
12
  TransactionExecution,
13
13
  StringMap,
14
- } from '../BaseEvent/Transaction'
15
- import Utils from '../Util/Utils'
14
+ } from '../BaseEvent/Transaction.js'
15
+ import Utils from '../Util/Utils.js'
16
16
 
17
17
  /**
18
18
  * Represents a route in an API.
@@ -1,6 +1,6 @@
1
- import Proxy from './container/Proxy'
2
- import Server from './Server'
3
- import { RouterConfig } from '../Router'
1
+ import Proxy from './container/Proxy.js'
2
+ import Server from './Server.js'
3
+ import { RouterConfig } from '../Router.js'
4
4
 
5
5
  /**
6
6
  * Represents a server container that extends the Server class and handles serverless events.
@@ -1,12 +1,12 @@
1
1
  import { APIGatewayProxyEvent, Context } from 'aws-lambda'
2
2
  import { pathToRegexp } from 'path-to-regexp'
3
3
 
4
- import Request from '../../API/Request'
5
- import Response, { ResponseErrorType } from '../../API/Response'
6
- import Transaction, { StringMap } from '../../BaseEvent/Transaction'
7
- import Validator from '../../Validation/Validator'
8
- import { RouterConfig } from '../Router'
9
- import RouteResolver from '../RouteResolver'
4
+ import Request from '../../API/Request.js'
5
+ import Response, { ResponseErrorType } from '../../API/Response.js'
6
+ import Transaction, { StringMap } from '../../BaseEvent/Transaction.js'
7
+ import Validator from '../../Validation/Validator.js'
8
+ import { RouterConfig } from '../Router.js'
9
+ import RouteResolver from '../RouteResolver.js'
10
10
 
11
11
  /**
12
12
  * Represents a server that handles serverless events and routes them to appropriate handlers.
@@ -1,9 +1,9 @@
1
1
  import { Request, Response } from 'express'
2
2
 
3
- import GenericHandlerEvent, { GenericHandlerEventResponse } from './GenericHandlerEvent'
4
- import Globals from '../../../Globals'
5
- import Utils from '../../../Util/Utils'
6
- import Server from '../Server'
3
+ import GenericHandlerEvent, { GenericHandlerEventResponse } from './GenericHandlerEvent.js'
4
+ import Globals from '../../../Globals.js'
5
+ import Utils from '../../../Util/Utils.js'
6
+ import Server from '../Server.js'
7
7
 
8
8
  /**
9
9
  * Creates an async function that handles serverless events and sends a response.
@@ -2,9 +2,9 @@ import type { APIGatewayProxyEvent, Context } from 'aws-lambda'
2
2
  import cuid from 'cuid'
3
3
  import { Request } from 'express'
4
4
 
5
- import { parseMultiValueQueryStringParameters, parseQueryStringParameters } from './Utils'
6
- import Globals from '../../../Globals'
7
- import Server from '../Server'
5
+ import { parseMultiValueQueryStringParameters, parseQueryStringParameters } from './Utils.js'
6
+ import Globals from '../../../Globals.js'
7
+ import Server from '../Server.js'
8
8
 
9
9
  /**
10
10
  * Represents the response object returned by a generic event handler.
@@ -4,12 +4,12 @@ import { Server as HTTPServer, createServer } from 'http'
4
4
  import cors from 'cors'
5
5
  import express from 'express'
6
6
 
7
- import Server from './../Server'
8
- import GenericHandler from './GenericHandler'
9
- import HealthHandler from './HealthHandler'
10
- import Globals from '../../../Globals'
11
- import Utils from '../../../Util/Utils'
12
- import { RouterConfig } from '../../Router'
7
+ import Server from './../Server.js'
8
+ import GenericHandler from './GenericHandler.js'
9
+ import HealthHandler from './HealthHandler.js'
10
+ import Globals from '../../../Globals.js'
11
+ import Utils from '../../../Util/Utils.js'
12
+ import { RouterConfig } from '../../Router.js'
13
13
 
14
14
  /* Get package.json version from Wapi on ESM */
15
15
  const { version: appVersion } = JSON.parse(fs.readFileSync('package.json').toString())
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod'
2
2
 
3
- import Response, { ResponseErrorType } from '../API/Response'
4
- import Globals from '../Globals'
3
+ import Response, { ResponseErrorType } from '../API/Response.js'
4
+ import Globals from '../Globals.js'
5
5
 
6
6
  /**
7
7
  * Validates the given data against the provided schema.
@@ -1,8 +1,8 @@
1
1
  import { APIGatewayEvent, Context } from 'aws-lambda'
2
2
  import { expect } from 'chai'
3
3
 
4
- import Request, { HttpMethod } from '../../src/API/Request'
5
- import Logger from '../../src/Logger/Logger'
4
+ import Request, { HttpMethod } from '../../src/API/Request.js'
5
+ import Logger from '../../src/Logger/Logger.js'
6
6
 
7
7
  function newReq(event: any, context?: any) {
8
8
  const logger = new Logger(
@@ -2,10 +2,10 @@ import { jest } from '@jest/globals'
2
2
  import { APIGatewayEvent, Context } from 'aws-lambda'
3
3
  import { expect as c_expect } from 'chai'
4
4
 
5
- import Response from '../../src/API/Response'
6
- import Transaction from '../../src/BaseEvent/Transaction'
7
- import Globals from '../../src/Globals'
8
- import { observableTransaction, defaultHeaders } from '../Test.utils'
5
+ import Response from '../../src/API/Response.js'
6
+ import Transaction from '../../src/BaseEvent/Transaction.js'
7
+ import Globals from '../../src/Globals.js'
8
+ import { observableTransaction, defaultHeaders } from '../Test.utils.js'
9
9
 
10
10
  async function testResponse(r: Response<any>, body: any, optCode?: number, optHeaders?: any) {
11
11
  const t = observableTransaction()
@@ -1,6 +1,6 @@
1
1
  import { expect } from 'chai'
2
2
 
3
- import Utils from '../../src/Util/Utils'
3
+ import Utils from '../../src/Util/Utils.js'
4
4
 
5
5
  describe('isHybridlessContainer', () => {
6
6
  test('Simple isHybridlessContainer test', () => {
@@ -1,9 +1,9 @@
1
1
  import { expect as c_expect } from 'chai'
2
2
 
3
- import Response from '../../src/API/Response'
4
- import EventProcessor from '../../src/BaseEvent/EventProcessor'
5
- import Globals from '../../src/Globals'
6
- import { emptyQueueEvent, observableContext } from '../Test.utils'
3
+ import Response from '../../src/API/Response.js'
4
+ import EventProcessor from '../../src/BaseEvent/EventProcessor.js'
5
+ import Globals from '../../src/Globals.js'
6
+ import { emptyQueueEvent, observableContext } from '../Test.utils.js'
7
7
 
8
8
  describe('EventProcessor success invocation path', () => {
9
9
  test('Simple success', async () => {
@@ -1,7 +1,7 @@
1
1
  import { expect } from 'chai'
2
2
 
3
- import Response from '../../src/API/Response'
4
- import Process from '../../src/BaseEvent/Process'
3
+ import Response from '../../src/API/Response.js'
4
+ import Process from '../../src/BaseEvent/Process.js'
5
5
 
6
6
  describe('Process success invocation path', () => {
7
7
  test('Simple success', async () => {
@@ -1,11 +1,11 @@
1
1
  import { jest } from '@jest/globals'
2
2
  import { expect as c_expect } from 'chai'
3
3
 
4
- import Response from '../../src/API/Response'
5
- import Transaction from '../../src/BaseEvent/Transaction'
6
- import type { DbConfig } from '../../src/Database/types'
7
- import Globals from '../../src/Globals'
8
- import { defaultHeaders, emptyEvent, observableContext } from '../Test.utils'
4
+ import Response from '../../src/API/Response.js'
5
+ import Transaction from '../../src/BaseEvent/Transaction.js'
6
+ import type { DbConfig } from '../../src/Database/types.js'
7
+ import Globals from '../../src/Globals.js'
8
+ import { defaultHeaders, emptyEvent, observableContext } from '../Test.utils.js'
9
9
 
10
10
  describe('Transaction success invocation path', () => {
11
11
  test('Simple success', async () => {
@@ -1,6 +1,6 @@
1
1
  import { jest } from '@jest/globals'
2
2
 
3
- import Redis from '../../src/Cache/Redis'
3
+ import Redis from '../../src/Cache/Redis.js'
4
4
 
5
5
  let _connectionId = 1
6
6
 
@@ -1,6 +1,6 @@
1
1
  import { jest } from '@jest/globals'
2
2
 
3
- import Redis from '../../src/Cache/Redis'
3
+ import Redis from '../../src/Cache/Redis.js'
4
4
 
5
5
  let _connectionId = 1
6
6
 
@@ -2,8 +2,8 @@ import { SSMClient, GetParameterCommand } from '@aws-sdk/client-ssm'
2
2
  import { mockClient } from 'aws-sdk-client-mock'
3
3
  import { expect as c_expect } from 'chai'
4
4
 
5
- import Configuration from '../../src/Config/Configuration'
6
- import { SampleConfig } from '../Test.utils'
5
+ import Configuration from '../../src/Config/Configuration.js'
6
+ import { SampleConfig } from '../Test.utils.js'
7
7
 
8
8
  const SSMMock = mockClient(SSMClient)
9
9
  const config = new Configuration<typeof SampleConfig>(SampleConfig, 'my-prefix')
@@ -3,7 +3,7 @@ import { SSMClient, GetParameterCommand } from '@aws-sdk/client-ssm'
3
3
  import { mockClient } from 'aws-sdk-client-mock'
4
4
  import { expect } from 'chai'
5
5
 
6
- import EnvironmentVar, { EnvironmentType } from '../../src/Config/EnvironmentVar'
6
+ import EnvironmentVar, { EnvironmentType } from '../../src/Config/EnvironmentVar.js'
7
7
 
8
8
  const SSMMock = mockClient(SSMClient)
9
9
  const SecretsManagerMock = mockClient(SecretsManagerClient)
@@ -2,7 +2,7 @@ import { DecryptCommand, EncryptCommand, KMSClient } from '@aws-sdk/client-kms'
2
2
  import { mockClient } from 'aws-sdk-client-mock'
3
3
  import { expect } from 'chai'
4
4
 
5
- import Crypto from '../../src/Crypto/Crypto'
5
+ import Crypto from '../../src/Crypto/Crypto.js'
6
6
 
7
7
  const KMSMock = mockClient(KMSClient)
8
8
 
@@ -1,7 +1,7 @@
1
1
  import { expect } from 'chai'
2
2
 
3
- import JWT from '../../src/Crypto/JWT'
4
- import { foreignToken, privateKey } from '../Test.utils'
3
+ import JWT from '../../src/Crypto/JWT.js'
4
+ import { foreignToken, privateKey } from '../Test.utils.js'
5
5
 
6
6
  describe('Creates token', () => {
7
7
  const provider = new JWT(privateKey, '7d')
@@ -1,8 +1,8 @@
1
1
  import { jest } from '@jest/globals'
2
2
  import { expect } from 'chai'
3
3
 
4
- import { DatabaseManager } from '../../src/Database'
5
- import type { DatabaseType, DbConfig } from '../../src/Database/types'
4
+ import { DatabaseManager } from '../../src/Database/index.js'
5
+ import type { DatabaseType, DbConfig } from '../../src/Database/types.js'
6
6
 
7
7
  type FakeDatabase = { host: string; type: 'knex' | 'pg' | 'kysely' }
8
8
 
@@ -1,8 +1,8 @@
1
1
  import { jest } from '@jest/globals'
2
2
  import { Knex } from 'knex'
3
3
 
4
- import type { DbConfig } from '../../../../src/Database'
5
- import { KnexDatabase } from '../../../../src/Database/integrations/knex/KnexDatabase'
4
+ import type { DbConfig } from '../../../../src/Database/index.js'
5
+ import { KnexDatabase } from '../../../../src/Database/integrations/knex/KnexDatabase.js'
6
6
 
7
7
  const config: DbConfig<'knex'> = {
8
8
  type: 'knex',
@@ -1,9 +1,9 @@
1
1
  import { jest } from '@jest/globals'
2
2
  import { Knex } from 'knex'
3
3
 
4
- import { DbConfig } from '../../../../src/Database'
5
- import { KnexDatabase } from '../../../../src/Database/integrations/knex/KnexDatabase'
6
- import { KnexTransactionImpl } from '../../../../src/Database/integrations/knex/KnexTransaction'
4
+ import { DbConfig } from '../../../../src/Database/index.js'
5
+ import { KnexDatabase } from '../../../../src/Database/integrations/knex/KnexDatabase.js'
6
+ import { KnexTransactionImpl } from '../../../../src/Database/integrations/knex/KnexTransaction.js'
7
7
 
8
8
  const testResources = async (config: Partial<DbConfig<'knex'>>) => {
9
9
  const database = {
@@ -2,8 +2,8 @@ import { jest } from '@jest/globals'
2
2
  import { PostgresDialect } from 'kysely'
3
3
  import * as pg from 'pg'
4
4
 
5
- import type { DbConfig } from '../../../../src/Database'
6
- import { KyselyDatabase } from '../../../../src/Database/integrations/kysely/KyselyDatabase'
5
+ import type { DbConfig } from '../../../../src/Database/index.js'
6
+ import { KyselyDatabase } from '../../../../src/Database/integrations/kysely/KyselyDatabase.js'
7
7
 
8
8
  const config: DbConfig<'kysely'> = {
9
9
  type: 'kysely',
@@ -1,9 +1,9 @@
1
1
  import { jest } from '@jest/globals'
2
2
  import { Kysely, Transaction } from 'kysely'
3
3
 
4
- import type { DbConfig } from '../../../../src/Database'
5
- import { KyselyDatabase } from '../../../../src/Database/integrations/kysely/KyselyDatabase'
6
- import { KyselyTransactionImpl } from '../../../../src/Database/integrations/kysely/KyselyTransaction'
4
+ import type { DbConfig } from '../../../../src/Database/index.js'
5
+ import { KyselyDatabase } from '../../../../src/Database/integrations/kysely/KyselyDatabase.js'
6
+ import { KyselyTransactionImpl } from '../../../../src/Database/integrations/kysely/KyselyTransaction.js'
7
7
 
8
8
  const testResources = async (config: Partial<DbConfig<'kysely'>>) => {
9
9
  type DB = {
@@ -1,8 +1,8 @@
1
1
  import { jest } from '@jest/globals'
2
2
  import * as pg from 'pg'
3
3
 
4
- import type { DbConfig } from '../../../../src/Database'
5
- import { PostgresDatabase } from '../../../../src/Database/integrations/pgsql/PostgresDatabase'
4
+ import type { DbConfig } from '../../../../src/Database/index.js'
5
+ import { PostgresDatabase } from '../../../../src/Database/integrations/pgsql/PostgresDatabase.js'
6
6
 
7
7
  const config: DbConfig<'pg'> = {
8
8
  type: 'pg',
@@ -1,9 +1,9 @@
1
1
  import { jest } from '@jest/globals'
2
2
  import * as pg from 'pg'
3
3
 
4
- import type { DbConfig } from '../../../../src/Database'
5
- import { PostgresDatabase } from '../../../../src/Database/integrations/pgsql/PostgresDatabase'
6
- import { PostgresTransactionImpl } from '../../../../src/Database/integrations/pgsql/PostgresTransaction'
4
+ import type { DbConfig } from '../../../../src/Database/index.js'
5
+ import { PostgresDatabase } from '../../../../src/Database/integrations/pgsql/PostgresDatabase.js'
6
+ import { PostgresTransactionImpl } from '../../../../src/Database/integrations/pgsql/PostgresTransaction.js'
7
7
 
8
8
  const testResources = async (config: Partial<DbConfig<'pg'>>) => {
9
9
  const database = {
@@ -5,7 +5,7 @@ import { expect as c_expect } from 'chai'
5
5
  const consoleProxy = console
6
6
  const mock = jest.spyOn(consoleProxy, 'log')
7
7
  // import logger after first ref
8
- import Logger from '../../src/Logger/Logger'
8
+ import Logger from '../../src/Logger/Logger.js'
9
9
  // get console reference after logger import
10
10
  const transactionID = '123-456'
11
11
 
@@ -2,7 +2,7 @@ import { SESClient, SendRawEmailCommand } from '@aws-sdk/client-ses'
2
2
  import { mockClient } from 'aws-sdk-client-mock'
3
3
  import { expect } from 'chai'
4
4
 
5
- import Mailer from '../../src/Mailer/Mailer'
5
+ import Mailer from '../../src/Mailer/Mailer.js'
6
6
 
7
7
  const SESMock = mockClient(SESClient)
8
8
 
@@ -2,7 +2,7 @@ import { SNSClient, PublishCommand } from '@aws-sdk/client-sns'
2
2
  import { mockClient } from 'aws-sdk-client-mock'
3
3
  import { expect } from 'chai'
4
4
 
5
- import Publisher from '../../src/Publisher/Publisher'
5
+ import Publisher from '../../src/Publisher/Publisher.js'
6
6
 
7
7
  const SNSMock = mockClient(SNSClient)
8
8
 
@@ -1,6 +1,6 @@
1
- import { HttpMethod } from '../../src/API/Request'
2
- import { Route } from '../../src/Server/Router'
3
- import RouteResolver from '../../src/Server/RouteResolver'
1
+ import { HttpMethod } from '../../src/API/Request.js'
2
+ import { Route } from '../../src/Server/Router.js'
3
+ import RouteResolver from '../../src/Server/RouteResolver.js'
4
4
 
5
5
  const mockRoute = (method: HttpMethod, path: string) =>
6
6
  ({
@@ -1,9 +1,9 @@
1
1
  import { jest } from '@jest/globals'
2
2
  import { expect } from 'chai'
3
3
 
4
- import ContainerServer from '../../src/Server/lib/ContainerServer'
5
- import Server from '../../src/Server/lib/Server'
6
- import Router from '../../src/Server/Router'
4
+ import ContainerServer from '../../src/Server/lib/ContainerServer.js'
5
+ import Server from '../../src/Server/lib/Server.js'
6
+ import Router from '../../src/Server/Router.js'
7
7
 
8
8
  describe('Router basics', () => {
9
9
  // @ts-ignore
@@ -3,11 +3,11 @@ import { expect as c_expect } from 'chai'
3
3
  import request from 'supertest'
4
4
  import { z } from 'zod'
5
5
 
6
- import { HttpMethod } from '../../../src/API/Request'
7
- import Response from '../../../src/API/Response'
8
- import Globals from '../../../src/Globals'
9
- import ContainerServer from '../../../src/Server/lib/ContainerServer'
10
- import { defaultUrl } from '../../Test.utils'
6
+ import { HttpMethod } from '../../../src/API/Request.js'
7
+ import Response from '../../../src/API/Response.js'
8
+ import Globals from '../../../src/Globals.js'
9
+ import ContainerServer from '../../../src/Server/lib/ContainerServer.js'
10
+ import { defaultUrl } from '../../Test.utils.js'
11
11
 
12
12
  export const ViewSchema = z.object({
13
13
  id: z.string(),
@@ -1,6 +1,6 @@
1
1
  import { expect } from 'chai'
2
2
 
3
- import Server from '../../../src/Server/lib/Server'
3
+ import Server from '../../../src/Server/lib/Server.js'
4
4
 
5
5
  describe('Server basics', () => {
6
6
  test('Works', async () => {
@@ -3,8 +3,8 @@ import { APIGatewayProxyEvent, Context } from 'aws-lambda'
3
3
  import { expect as c_expect } from 'chai'
4
4
  import { Request, Response } from 'express'
5
5
 
6
- import Globals from '../../../../src/Globals'
7
- import GenericHandler from '../../../../src/Server/lib/container/GenericHandler'
6
+ import Globals from '../../../../src/Globals.js'
7
+ import GenericHandler from '../../../../src/Server/lib/container/GenericHandler.js'
8
8
 
9
9
  function observableResponse(): Response {
10
10
  const resp = <Response>(<unknown>{
@@ -2,8 +2,8 @@ import { APIGatewayProxyEvent, Context } from 'aws-lambda'
2
2
  import { expect } from 'chai'
3
3
  import { Request } from 'express'
4
4
 
5
- import { HttpMethod } from '../../../../src/API/Request'
6
- import GenericHandlerEvent from '../../../../src/Server/lib/container/GenericHandlerEvent'
5
+ import { HttpMethod } from '../../../../src/API/Request.js'
6
+ import GenericHandlerEvent from '../../../../src/Server/lib/container/GenericHandlerEvent.js'
7
7
 
8
8
  describe('GenericHandlerEvent invocation paths', () => {
9
9
  test('Simple success', async () => {
@@ -2,7 +2,7 @@ import { jest } from '@jest/globals'
2
2
  import { expect as c_expect } from 'chai'
3
3
  import { Request, Response } from 'express'
4
4
 
5
- import HealthHandler from '../../../../src/Server/lib/container/HealthHandler'
5
+ import HealthHandler from '../../../../src/Server/lib/container/HealthHandler.js'
6
6
 
7
7
  function observableResponse(): Response {
8
8
  const resp = <Response>(<unknown>{
@@ -3,9 +3,9 @@ import { APIGatewayProxyEvent, Context } from 'aws-lambda'
3
3
  import { expect as c_expect } from 'chai'
4
4
  import request from 'supertest'
5
5
 
6
- import Globals from '../../../../src/Globals'
7
- import Proxy from '../../../../src/Server/lib/container/Proxy'
8
- import { defaultUrl } from '../../../Test.utils'
6
+ import Globals from '../../../../src/Globals.js'
7
+ import Proxy from '../../../../src/Server/lib/container/Proxy.js'
8
+ import { defaultUrl } from '../../../Test.utils.js'
9
9
 
10
10
  describe('Proxy configs', () => {
11
11
  // @ts-ignore
@@ -1,6 +1,6 @@
1
1
  import { expect } from 'chai'
2
2
 
3
- import * as Utils from '../../../../src/Server/lib/container/Utils'
3
+ import * as Utils from '../../../../src/Server/lib/container/Utils.js'
4
4
 
5
5
  describe('parseQueryStringParameters', () => {
6
6
  test('Null url', () => {
@@ -2,8 +2,8 @@ import { jest } from '@jest/globals'
2
2
  import { APIGatewayEvent, Context, SQSEvent } from 'aws-lambda'
3
3
  import { z } from 'zod'
4
4
 
5
- import Transaction from '../src/BaseEvent/Transaction'
6
- import Globals from '../src/Globals'
5
+ import Transaction from '../src/BaseEvent/Transaction.js'
6
+ import Globals from '../src/Globals.js'
7
7
 
8
8
  export const defaultHeaders = {
9
9
  'Access-Control-Allow-Credentials': true,