diff --git a/.markdownlint.jsonc b/.markdownlint.jsonc new file mode 100644 index 00000000..a2672f79 --- /dev/null +++ b/.markdownlint.jsonc @@ -0,0 +1,11 @@ +// SEE: https://github.com/DavidAnson/markdownlint/blob/main/schema/.markdownlint.yaml +{ + // https://github.com/DavidAnson/markdownlint/blob/main/doc/md013.md + "MD013": false, + // https://github.com/DavidAnson/markdownlint/blob/main/doc/md024.md + "MD024": { + "siblings_only": true + }, + // https://github.com/DavidAnson/markdownlint/blob/main/doc/md033.md + "MD033": false +} diff --git a/.syncpackrc b/.syncpackrc new file mode 100644 index 00000000..492a898b --- /dev/null +++ b/.syncpackrc @@ -0,0 +1,10 @@ +{ + "versionGroups": [ + { + "dependencies": ["@internal/**", "@nhsdigital/nhs-notify-event-schemas-supplier-api"], + "specifierTypes": ["*"], + "label": "Internal deps", + "isIgnored": true + } + ] +} diff --git a/internal/datastore/jest.config.ts b/internal/datastore/jest.config.ts index d30f4cd1..129da6a6 100644 --- a/internal/datastore/jest.config.ts +++ b/internal/datastore/jest.config.ts @@ -15,6 +15,11 @@ export const baseJestConfig: Config = { // Indicates which provider should be used to instrument code for coverage coverageProvider: 'babel', + // Module name mapper to handle TypeScript path aliases + moduleNameMapper: { + '^@internal/helpers$': '/../helpers/src' + }, + coverageThreshold: { global: { branches: 100, diff --git a/internal/datastore/package.json b/internal/datastore/package.json index bdd757f4..3f168769 100644 --- a/internal/datastore/package.json +++ b/internal/datastore/package.json @@ -2,8 +2,9 @@ "dependencies": { "@aws-sdk/client-dynamodb": "^3.858.0", "@aws-sdk/lib-dynamodb": "^3.858.0", + "@internal/helpers": "*", "pino": "^9.7.0", - "zod": "^4.0.14" + "zod": "^4.1.11" }, "devDependencies": { "@stylistic/eslint-plugin": "^3.1.0", @@ -18,15 +19,15 @@ "testcontainers": "^11.4.0", "ts-jest": "^29.4.0", "ts-node": "^10.9.2", - "typescript": "^5.8.2", + "typescript": "^5.8.3", "zod-mermaid": "^1.0.9" }, "license": "MIT", "main": "src/index.ts", - "name": "datastore", + "name": "@internal/datastore", "private": true, "scripts": { - "diagrams": "ts-node src/cli/diagrams.ts", + "diagrams": "tsx src/cli/diagrams.ts", "lint": "eslint .", "lint:fix": "eslint . --fix", "test:unit": "jest", diff --git a/internal/datastore/src/cli/diagrams.ts b/internal/datastore/src/cli/diagrams.ts index ca644c0f..c9e8ad3c 100644 --- a/internal/datastore/src/cli/diagrams.ts +++ b/internal/datastore/src/cli/diagrams.ts @@ -1,4 +1,4 @@ -import { LetterSchema, MISchema } from '../types'; +import {LetterSchema, MISchema, SupplierSchema} from '../types'; import { generateMermaidDiagram } from 'zod-mermaid'; import * as fs from 'node:fs'; @@ -11,7 +11,7 @@ This document contains the mermaid diagrams for the data store schemas used in t The schemas are generated from Zod definitions and provide a visual representation of the data structure. `); -for (const [name, schema] of Object.entries({ Letter: [LetterSchema], MI: [MISchema] })) { +for (const [name, schema] of Object.entries({ Letter: [LetterSchema], MI: [MISchema], Supplier: [SupplierSchema] })) { const mermaid = generateMermaidDiagram(schema); fs.writeSync(out, ` ## ${name} schema diff --git a/internal/datastore/src/types.md b/internal/datastore/src/types.md index 06b65f0e..0ca598a8 100644 --- a/internal/datastore/src/types.md +++ b/internal/datastore/src/types.md @@ -31,7 +31,7 @@ erDiagram erDiagram MI { string id - string supplierId "ref: Supplier" + string supplierId string specificationId string groupId string lineItem @@ -40,7 +40,16 @@ erDiagram string createdAt string updatedAt } +``` + +## Supplier schema + +```mermaid +erDiagram Supplier { + string id + string name + string apimId + string status "enum: ENABLED, DISABLED" } - MI }o--|| Supplier : "supplierId" ``` diff --git a/internal/datastore/src/types.ts b/internal/datastore/src/types.ts index 88c18f36..1eb1e815 100644 --- a/internal/datastore/src/types.ts +++ b/internal/datastore/src/types.ts @@ -1,5 +1,5 @@ import { z } from 'zod'; -import { idRef } from 'zod-mermaid'; +import { idRef } from '@internal/helpers'; export const SupplerStatus = z.enum(['ENABLED', 'DISABLED']); @@ -29,7 +29,7 @@ export const LetterSchemaBase = z.object({ }); export const LetterSchema = LetterSchemaBase.extend({ - supplierId: z.string(), + supplierId: idRef(SupplierSchema, 'id'), url: z.url(), createdAt: z.string(), updatedAt: z.string(), @@ -57,7 +57,7 @@ export const MISchemaBase = z.object({ }); export const MISchema = MISchemaBase.extend({ - supplierId: idRef(SupplierSchema), + supplierId: idRef(SupplierSchema, 'id'), createdAt: z.string(), updatedAt: z.string(), ttl: z.int(), diff --git a/internal/datastore/tsconfig.json b/internal/datastore/tsconfig.json index a08833f4..24902365 100644 --- a/internal/datastore/tsconfig.json +++ b/internal/datastore/tsconfig.json @@ -1,8 +1,6 @@ { - "compilerOptions": { - "isolatedModules": true - }, - "extends": "@tsconfig/node22/tsconfig.json", + "compilerOptions": {}, + "extends": "../../tsconfig.base.json", "include": [ "src/**/*", "jest.config.ts" diff --git a/internal/helpers/.gitignore b/internal/helpers/.gitignore new file mode 100644 index 00000000..62df6623 --- /dev/null +++ b/internal/helpers/.gitignore @@ -0,0 +1,24 @@ +# Dependency directories +node_modules/ + +# Built output +dist/ + +# Coverage directory used by tools like istanbul +coverage/ + +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Editor directories and files +.idea/ +.vscode/ +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/internal/helpers/jest.config.ts b/internal/helpers/jest.config.ts new file mode 100644 index 00000000..3c1866d9 --- /dev/null +++ b/internal/helpers/jest.config.ts @@ -0,0 +1,15 @@ +import type { Config } from "jest"; + +const config: Config = { + preset: "ts-jest", + testEnvironment: "node", + testMatch: ["**/src/__tests__/**/*.ts?(x)", "**/src/?(*.)+(spec|test).ts?(x)"], + collectCoverageFrom: ["src/**/*.ts"], + coveragePathIgnorePatterns: ["/node_modules/", "__tests__"], + testPathIgnorePatterns: ["/node_modules/", "/dist/"], + transform: { + "^.+\\.tsx?$": ["ts-jest", { }] + } +}; + +export default config; diff --git a/internal/helpers/package.json b/internal/helpers/package.json new file mode 100644 index 00000000..c6852074 --- /dev/null +++ b/internal/helpers/package.json @@ -0,0 +1,32 @@ +{ + "dependencies": { + "zod": "^4.1.11" + }, + "description": "Common helper utilities for NHS Notify Supplier API", + "devDependencies": { + "@stylistic/eslint-plugin": "^3.1.0", + "@tsconfig/node22": "^22.0.2", + "@types/jest": "^29.5.14", + "@typescript-eslint/eslint-plugin": "^8.27.0", + "@typescript-eslint/parser": "^8.27.0", + "eslint": "^9.27.0", + "eslint-plugin-jest": "^29.0.1", + "jest": "^30.1.3", + "ts-jest": "^29.4.0", + "ts-node": "^10.9.2", + "typescript": "^5.8.3" + }, + "license": "MIT", + "main": "src/index.ts", + "name": "@internal/helpers", + "private": true, + "scripts": { + "build": "tsc", + "lint": "eslint .", + "lint:fix": "eslint . --fix", + "test": "jest", + "test:unit": "jest", + "typecheck": "tsc --noEmit" + }, + "version": "0.1.0" +} diff --git a/internal/helpers/src/__tests__/id-ref.test.ts b/internal/helpers/src/__tests__/id-ref.test.ts new file mode 100644 index 00000000..3204b305 --- /dev/null +++ b/internal/helpers/src/__tests__/id-ref.test.ts @@ -0,0 +1,41 @@ +import { z } from "zod"; +import { idRef } from "../id-ref"; + +describe("idRef", () => { + const TestSchema = z.object({ + domainId: z.uuid(), + name: z.string(), + }); + + it("should create an ID reference with the same type as the source schema's ID field", () => { + const refField = idRef(TestSchema); + + // Should validate UUIDs like the original schema's domainId + expect(() => refField.parse("not-a-uuid")).toThrow(); + expect(() => refField.parse("123e4567-e89b-12d3-a456-426614174000")).not.toThrow(); + }); + + it("should add reference metadata", () => { + const refField = idRef(TestSchema, "domainId", "TestEntity"); + + expect(refField).toBeDefined(); + expect(z.globalRegistry.has(refField)).toBe(true); + expect(z.globalRegistry.get(refField)).toEqual(expect.objectContaining({ + title: "TestEntity ID Reference", + description: "Reference to a TestEntity by its unique identifier", + })); + }); + + it("should use custom ID field name when provided", () => { + const CustomSchema = z.object({ + customId: z.number(), + name: z.string(), + }); + + const refField = idRef(CustomSchema, "customId"); + + // Should validate numbers like the custom ID field + expect(() => refField.parse("not-a-number")).toThrow(); + expect(() => refField.parse(123)).not.toThrow(); + }); +}); diff --git a/internal/helpers/src/domain-base.ts b/internal/helpers/src/domain-base.ts new file mode 100644 index 00000000..c738220a --- /dev/null +++ b/internal/helpers/src/domain-base.ts @@ -0,0 +1,18 @@ +import { z } from "zod"; + +export function DomainBase( + type: T, +): z.ZodObject<{ domainId: z.core.$ZodBranded }> { + const idType = z + .string() + .brand(type) + .meta({ + title: `${type} ID`, + description: `Unique identifier for the ${type}`, + examples: ["1y3q9v1zzzz"], + }) as z.core.$ZodBranded; + + return z.object({ + domainId: idType, + }); +} diff --git a/internal/helpers/src/environment.ts b/internal/helpers/src/environment.ts new file mode 100644 index 00000000..ce997d4f --- /dev/null +++ b/internal/helpers/src/environment.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** + * Deployment / execution environment identifier. + * Intentionally liberal; constrain in callers as needed. + */ +export const $Environment = z.string().meta({ + title: 'Environment', + description: 'The environment in which the configuration has effect', + examples: ['dev', 'int', 'prod'], +}); diff --git a/internal/helpers/src/id-ref.ts b/internal/helpers/src/id-ref.ts new file mode 100644 index 00000000..e757725d --- /dev/null +++ b/internal/helpers/src/id-ref.ts @@ -0,0 +1,65 @@ +import { z } from "zod"; + +/** + * Creates a field that references another entity by ID, inferring the type from the referenced + * schema's domainId field. + * This allows you to indicate relationships without embedding the full entity. + * + * @param schema - The Zod object schema representing the referenced entity + * @param idFieldName - The name of the ID field in the referenced schema (default: 'domainId') + * @param entityName - Optional custom name for the referenced entity + * @returns A Zod schema for the ID field with reference metadata, with the type inferred from + * the referenced schema + * + * @example + * import { z } from 'zod'; + * import { idRef } from './id-ref'; + * + * const CustomerSchema = z.object({ domainId: z.string() }); + * const OrderSchema = z.object({ + * domainId: z.string(), + * customerId: idRef(CustomerSchema), // Inferred as ZodString + * }); + */ +// Overload for when a specific ID field is provided +export function idRef< + T extends z.ZodObject>, + K extends keyof T["shape"] & string +>(schema: T, idFieldName: K, entityName?: string): T["shape"][K]; + +// Overload for when using the default "domainId" field +export function idRef< + T extends z.ZodObject> & { + shape: { domainId: z.ZodTypeAny } + } +>(schema: T, idFieldName?: undefined, entityName?: string): T["shape"]["domainId"]; + +// Implementation +export function idRef< + T extends z.ZodObject>, + K extends keyof T["shape"] & string = "domainId", +>(schema: T, idFieldName?: K, entityName?: string): T["shape"][K] { + const { shape } = schema; + const field = idFieldName ?? "domainId"; + + if (!(field in shape)) { + throw new Error(`ID field '${field}' not found in schema`); + } + + // Get the ID field schema + const idFieldSchema = shape[field]; + if (!idFieldSchema) { + throw new Error(`ID field '${field}' not found in schema`); + } + + // Use the provided entity name or the schema description + const targetEntityName = entityName || schema.description || "Unknown"; + + // Create a new schema with the same type and validation as the ID field + const resultSchema = idFieldSchema.clone().meta({ + title: `${targetEntityName} ID Reference`, + description: `Reference to a ${targetEntityName} by its unique identifier`, + }); + + return resultSchema as T["shape"][K]; +} diff --git a/internal/helpers/src/index.ts b/internal/helpers/src/index.ts new file mode 100644 index 00000000..9a79b038 --- /dev/null +++ b/internal/helpers/src/index.ts @@ -0,0 +1,10 @@ +/** + * Common helper utilities for NHS Notify Supplier API + * @module helpers + */ + +// Export all helpers +export * from './version'; +export * from './environment'; +export * from "./id-ref"; +export * from "./domain-base"; diff --git a/internal/helpers/src/version.ts b/internal/helpers/src/version.ts new file mode 100644 index 00000000..ab1f300a --- /dev/null +++ b/internal/helpers/src/version.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +/** + * Semantic version (major.minor.patch) with numeric segments only. + * Branded for nominal typing. + */ +export const $Version = z + .string() + .regex(/^[0-9]+\.[0-9]+\.[0-9]+$/) + .brand('Version'); + +export type Version = z.infer; diff --git a/internal/helpers/tsconfig.json b/internal/helpers/tsconfig.json new file mode 100644 index 00000000..3ab61d96 --- /dev/null +++ b/internal/helpers/tsconfig.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "declaration": true + }, + "exclude": [ + "node_modules", + "dist" + ], + "extends": "../../tsconfig.base.json", + "include": [ + "src/**/*", + "jest.config.ts" + ] +} diff --git a/lambdas/api-handler/package.json b/lambdas/api-handler/package.json index 012daf8b..c5803e84 100644 --- a/lambdas/api-handler/package.json +++ b/lambdas/api-handler/package.json @@ -1,15 +1,19 @@ { "dependencies": { - "esbuild": "^0.24.0" + "@internal/datastore": "*", + "@internal/helpers": "*", + "esbuild": "^0.24.0", + "pino": "^9.7.0" }, "devDependencies": { "@aws-sdk/s3-request-presigner": "^3.901.0", "@tsconfig/node22": "^22.0.2", "@types/aws-lambda": "^8.10.148", - "@types/jest": "^30.0.0", + "@types/jest": "^29.5.14", "jest": "^30.1.3", - "jest-mock-extended": "^4.0.0", - "typescript": "^5.8.2" + "jest-mock-extended": "^3.0.7", + "typescript": "^5.8.3", + "zod": "^4.1.11" }, "name": "nhs-notify-supplier-api-handler", "private": true, diff --git a/lambdas/api-handler/src/config/__tests__/deps.test.ts b/lambdas/api-handler/src/config/__tests__/deps.test.ts index 3e2911a9..4381d961 100644 --- a/lambdas/api-handler/src/config/__tests__/deps.test.ts +++ b/lambdas/api-handler/src/config/__tests__/deps.test.ts @@ -33,7 +33,7 @@ describe('createDependenciesContainer', () => { })); // Repo client - jest.mock('../../../../../internal/datastore', () => ({ + jest.mock('@internal/datastore', () => ({ LetterRepository: jest.fn(), MIRepository: jest.fn(), })); @@ -46,7 +46,7 @@ describe('createDependenciesContainer', () => { // get current mock instances const { S3Client } = jest.requireMock('@aws-sdk/client-s3') as { S3Client: jest.Mock }; const pinoMock = jest.requireMock('pino') as { default: jest.Mock }; - const { LetterRepository, MIRepository } = jest.requireMock('../../../../../internal/datastore') as { + const { LetterRepository, MIRepository } = jest.requireMock('@internal/datastore') as { LetterRepository: jest.Mock, MIRepository: jest.Mock }; diff --git a/lambdas/api-handler/src/handlers/__tests__/get-letter-data.test.ts b/lambdas/api-handler/src/handlers/__tests__/get-letter-data.test.ts index 3cbde039..38c339ed 100644 --- a/lambdas/api-handler/src/handlers/__tests__/get-letter-data.test.ts +++ b/lambdas/api-handler/src/handlers/__tests__/get-letter-data.test.ts @@ -20,7 +20,7 @@ import * as errors from '../../contracts/errors'; import { createGetLetterDataHandler } from '../get-letter-data'; import { S3Client } from '@aws-sdk/client-s3'; import pino from 'pino'; -import { LetterRepository } from '../../../../../internal/datastore/src'; +import { LetterRepository } from '@internal/datastore/src'; import { EnvVars } from '../../config/env'; import { Deps } from "../../config/deps"; diff --git a/lambdas/api-handler/src/handlers/__tests__/get-letter.test.ts b/lambdas/api-handler/src/handlers/__tests__/get-letter.test.ts index a21325a5..742bf274 100644 --- a/lambdas/api-handler/src/handlers/__tests__/get-letter.test.ts +++ b/lambdas/api-handler/src/handlers/__tests__/get-letter.test.ts @@ -6,7 +6,7 @@ import { ApiErrorDetail } from '../../contracts/errors'; import { NotFoundError } from '../../errors'; import { S3Client } from '@aws-sdk/client-s3'; import pino from 'pino'; -import { LetterRepository } from '../../../../../internal/datastore/src'; +import { LetterRepository } from '@internal/datastore/src'; import { Deps } from '../../config/deps'; import { EnvVars } from '../../config/env'; import { createGetLetterHandler } from '../get-letter'; diff --git a/lambdas/api-handler/src/handlers/__tests__/get-letters.test.ts b/lambdas/api-handler/src/handlers/__tests__/get-letters.test.ts index 5177f25d..292538da 100644 --- a/lambdas/api-handler/src/handlers/__tests__/get-letters.test.ts +++ b/lambdas/api-handler/src/handlers/__tests__/get-letters.test.ts @@ -19,7 +19,7 @@ import { ValidationError } from '../../errors'; import * as errors from '../../contracts/errors'; import { S3Client } from '@aws-sdk/client-s3'; import pino from 'pino'; -import { LetterRepository } from '../../../../../internal/datastore/src'; +import { LetterRepository } from '@internal/datastore/src'; import { createGetLettersHandler } from '../get-letters'; import { Deps } from '../../config/deps'; import { EnvVars } from '../../config/env'; diff --git a/lambdas/api-handler/src/handlers/__tests__/patch-letter.test.ts b/lambdas/api-handler/src/handlers/__tests__/patch-letter.test.ts index 8e43b252..72737e4b 100644 --- a/lambdas/api-handler/src/handlers/__tests__/patch-letter.test.ts +++ b/lambdas/api-handler/src/handlers/__tests__/patch-letter.test.ts @@ -21,7 +21,7 @@ import { ValidationError } from '../../errors'; import * as errors from '../../contracts/errors'; import { S3Client } from '@aws-sdk/client-s3'; import pino from 'pino'; -import { LetterRepository } from '../../../../../internal/datastore/src'; +import { LetterRepository } from '@internal/datastore/src'; import { EnvVars } from '../../config/env'; import { createPatchLetterHandler } from '../patch-letter'; import { Deps } from "../../config/deps"; diff --git a/lambdas/api-handler/src/mappers/__tests__/letter-mapper.test.ts b/lambdas/api-handler/src/mappers/__tests__/letter-mapper.test.ts index b63825dc..f6f8e3dc 100644 --- a/lambdas/api-handler/src/mappers/__tests__/letter-mapper.test.ts +++ b/lambdas/api-handler/src/mappers/__tests__/letter-mapper.test.ts @@ -1,5 +1,5 @@ import { mapToGetLetterResponse, mapToGetLettersResponse, mapToPatchLetterResponse } from '../letter-mapper'; -import { Letter } from '../../../../../internal/datastore'; +import { Letter } from '@internal/datastore'; import { GetLetterResponse, GetLettersResponse, PatchLetterResponse } from '../../contracts/letters'; describe('letter-mapper', () => { diff --git a/lambdas/api-handler/src/mappers/letter-mapper.ts b/lambdas/api-handler/src/mappers/letter-mapper.ts index 971326fa..e0f73b93 100644 --- a/lambdas/api-handler/src/mappers/letter-mapper.ts +++ b/lambdas/api-handler/src/mappers/letter-mapper.ts @@ -1,8 +1,8 @@ -import { LetterBase, LetterStatus } from "../../../../internal/datastore"; +import { LetterBase, LetterStatus } from "@internal/datastore"; import { GetLetterResponse, GetLetterResponseSchema, GetLettersResponse, GetLettersResponseSchema, LetterDto, PatchLetterRequest, PatchLetterResponse, PatchLetterResponseSchema } from '../contracts/letters'; -export function mapToLetterDto(request: PatchLetterRequest, supplierId: string) : LetterDto { - return { +export function mapToLetterDto(request: PatchLetterRequest, supplierId: string): LetterDto { + return { id: request.data.id, supplierId, status: LetterStatus.parse(request.data.attributes.status), diff --git a/lambdas/api-handler/src/services/__tests__/letter-operations.test.ts b/lambdas/api-handler/src/services/__tests__/letter-operations.test.ts index 284931e8..1016061c 100644 --- a/lambdas/api-handler/src/services/__tests__/letter-operations.test.ts +++ b/lambdas/api-handler/src/services/__tests__/letter-operations.test.ts @@ -1,6 +1,6 @@ -import { Letter, LetterRepository } from '../../../../../internal/datastore/src'; +import { Letter, LetterRepository } from '@internal/datastore'; import { Deps } from '../../config/deps'; -import { LetterDto, LetterStatus } from '../../contracts/letters'; +import { LetterDto } from '../../contracts/letters'; import { getLetterById, getLetterDataUrl, getLettersForSupplier, patchLetterStatus } from '../letter-operations'; import pino from 'pino'; @@ -115,7 +115,8 @@ describe('patchLetterStatus function', () => { const result = await patchLetterStatus(updatedLetterDto, 'letter1', mockRepo as any); - expect(result).toEqual({ data: + expect(result).toEqual({ + data: { id: 'letter1', type: 'Letter', diff --git a/lambdas/api-handler/src/services/letter-operations.ts b/lambdas/api-handler/src/services/letter-operations.ts index 6249e86a..035aba2a 100644 --- a/lambdas/api-handler/src/services/letter-operations.ts +++ b/lambdas/api-handler/src/services/letter-operations.ts @@ -1,4 +1,4 @@ -import { LetterBase, LetterRepository } from '../../../../internal/datastore/src' +import { LetterBase, LetterRepository } from '@internal/datastore' import { NotFoundError, ValidationError } from '../errors'; import { LetterDto, PatchLetterResponse } from '../contracts/letters'; import { mapToPatchLetterResponse } from '../mappers/letter-mapper'; @@ -38,7 +38,7 @@ export const patchLetterStatus = async (letterToUpdate: LetterDto, letterId: str let updatedLetter; try { - updatedLetter = await letterRepo.updateLetterStatus(letterToUpdate); + updatedLetter = await letterRepo.updateLetterStatus(letterToUpdate); } catch (error) { if (isNotFoundError(error)) { throw new NotFoundError(ApiErrorDetail.NotFoundLetterId); diff --git a/lambdas/api-handler/tsconfig.json b/lambdas/api-handler/tsconfig.json index 7d8ef64e..24902365 100644 --- a/lambdas/api-handler/tsconfig.json +++ b/lambdas/api-handler/tsconfig.json @@ -1,11 +1,6 @@ { - "compilerOptions": { - "noImplicitAny": true, - "noUncheckedIndexedAccess": true, - "strict": true, - "strictNullChecks": true - }, - "extends": "@tsconfig/node22/tsconfig.json", + "compilerOptions": {}, + "extends": "../../tsconfig.base.json", "include": [ "src/**/*", "jest.config.ts" diff --git a/lambdas/authorizer/package.json b/lambdas/authorizer/package.json index d9eeb041..66827219 100644 --- a/lambdas/authorizer/package.json +++ b/lambdas/authorizer/package.json @@ -8,7 +8,7 @@ "@types/jest": "^30.0.0", "jest": "^30.1.3", "jest-mock-extended": "^4.0.0", - "typescript": "^5.8.2" + "typescript": "^5.8.3" }, "name": "nhs-notify-supplier-authorizer", "private": true, diff --git a/package-lock.json b/package-lock.json index 6f6ab08b..bda1d285 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,9 +6,8 @@ "": { "name": "nhs-notify-supplier-api", "workspaces": [ - "lambdas/api-handler", - "lambdas/authorizer", - "internal/datastore", + "lambdas/*", + "internal/*", "scripts/test-data", "docs" ], @@ -52,61 +51,1900 @@ "jest-mock-extended": "^4.0.0", "lcov-result-merger": "^5.0.1", "openapi-typescript": "^7.8.0", - "ts-jest": "^29.3.0", + "ts-jest": "^29.4.0", "ts-node": "^10.9.2", "tsx": "^4.19.3", "typescript": "^5.8.3" } }, - "docs": { - "name": "nhs-notify-docs", - "version": "1.0.0", + "docs": { + "name": "nhs-notify-docs", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "nhsuk-frontend": "^8.1.1" + }, + "devDependencies": {} + }, + "internal/datastore": { + "name": "@internal/datastore", + "version": "0.1.0", + "license": "MIT", + "dependencies": { + "@aws-sdk/client-dynamodb": "^3.858.0", + "@aws-sdk/lib-dynamodb": "^3.858.0", + "@internal/helpers": "*", + "pino": "^9.7.0", + "zod": "^4.1.11" + }, + "devDependencies": { + "@stylistic/eslint-plugin": "^3.1.0", + "@tsconfig/node22": "^22.0.2", + "@types/jest": "^30.0.0", + "@typescript-eslint/eslint-plugin": "^8.46.2", + "@typescript-eslint/parser": "^8.27.0", + "eslint": "^9.27.0", + "eslint-plugin-jest": "^29.0.1", + "jest": "^30.1.3", + "jest-mock-extended": "^4.0.0", + "testcontainers": "^11.4.0", + "ts-jest": "^29.4.0", + "ts-node": "^10.9.2", + "typescript": "^5.8.3", + "zod-mermaid": "^1.0.9" + } + }, + "internal/datastore/node_modules/zod": { + "version": "4.1.12", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, + "internal/helpers": { + "name": "@internal/helpers", + "version": "0.1.0", + "license": "MIT", + "dependencies": { + "zod": "^4.1.11" + }, + "devDependencies": { + "@stylistic/eslint-plugin": "^3.1.0", + "@tsconfig/node22": "^22.0.2", + "@types/jest": "^29.5.14", + "@typescript-eslint/eslint-plugin": "^8.27.0", + "@typescript-eslint/parser": "^8.27.0", + "eslint": "^9.27.0", + "eslint-plugin-jest": "^29.0.1", + "jest": "^29.7.0", + "ts-jest": "^29.4.0", + "ts-node": "^10.9.2", + "typescript": "^5.8.3" + } + }, + "internal/helpers/node_modules/@jest/core": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/console": "^29.7.0", + "@jest/reporters": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "jest-changed-files": "^29.7.0", + "jest-config": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-resolve-dependencies": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "jest-watcher": "^29.7.0", + "micromatch": "^4.0.4", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "internal/helpers/node_modules/@jest/environment": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "internal/helpers/node_modules/@jest/expect": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "expect": "^29.7.0", + "jest-snapshot": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "internal/helpers/node_modules/@jest/fake-timers": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@sinonjs/fake-timers": "^10.0.2", + "@types/node": "*", + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "internal/helpers/node_modules/@jest/globals": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/types": "^29.6.3", + "jest-mock": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "internal/helpers/node_modules/@jest/reporters": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@bcoe/v8-coverage": "^0.2.3", + "@jest/console": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", + "@types/node": "*", + "chalk": "^4.0.0", + "collect-v8-coverage": "^1.0.0", + "exit": "^0.1.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-instrument": "^6.0.0", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.1.3", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", + "slash": "^3.0.0", + "string-length": "^4.0.1", + "strip-ansi": "^6.0.0", + "v8-to-istanbul": "^9.0.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "internal/helpers/node_modules/@jest/source-map": { + "version": "29.6.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.18", + "callsites": "^3.0.0", + "graceful-fs": "^4.2.9" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "internal/helpers/node_modules/@jest/test-sequencer": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/test-result": "^29.7.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "internal/helpers/node_modules/@jest/transform": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.11.6", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", + "babel-plugin-istanbul": "^6.1.1", + "chalk": "^4.0.0", + "convert-source-map": "^2.0.0", + "fast-json-stable-stringify": "^2.1.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "micromatch": "^4.0.4", + "pirates": "^4.0.4", + "slash": "^3.0.0", + "write-file-atomic": "^4.0.2" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "internal/helpers/node_modules/@sinonjs/fake-timers": { + "version": "10.3.0", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@sinonjs/commons": "^3.0.0" + } + }, + "internal/helpers/node_modules/@types/jest": { + "version": "29.5.14", + "dev": true, + "license": "MIT", + "dependencies": { + "expect": "^29.0.0", + "pretty-format": "^29.0.0" + } + }, + "internal/helpers/node_modules/babel-jest": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/transform": "^29.7.0", + "@types/babel__core": "^7.1.14", + "babel-plugin-istanbul": "^6.1.1", + "babel-preset-jest": "^29.6.3", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.8.0" + } + }, + "internal/helpers/node_modules/babel-plugin-istanbul": { + "version": "6.1.1", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@babel/helper-plugin-utils": "^7.0.0", + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-instrument": "^5.0.4", + "test-exclude": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "internal/helpers/node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument": { + "version": "5.2.1", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@babel/core": "^7.12.3", + "@babel/parser": "^7.14.7", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "internal/helpers/node_modules/babel-plugin-istanbul/node_modules/semver": { + "version": "6.3.1", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "internal/helpers/node_modules/babel-plugin-jest-hoist": { + "version": "29.6.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.3.3", + "@babel/types": "^7.3.3", + "@types/babel__core": "^7.1.14", + "@types/babel__traverse": "^7.0.6" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "internal/helpers/node_modules/babel-preset-jest": { + "version": "29.6.3", + "dev": true, + "license": "MIT", + "dependencies": { + "babel-plugin-jest-hoist": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "internal/helpers/node_modules/brace-expansion": { + "version": "1.1.12", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "internal/helpers/node_modules/camelcase": { + "version": "6.3.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "internal/helpers/node_modules/ci-info": { + "version": "3.9.0", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "internal/helpers/node_modules/cjs-module-lexer": { + "version": "1.4.3", + "dev": true, + "license": "MIT" + }, + "internal/helpers/node_modules/cliui": { + "version": "8.0.1", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "internal/helpers/node_modules/glob": { + "version": "7.2.3", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "internal/helpers/node_modules/istanbul-lib-source-maps": { + "version": "4.0.1", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + }, + "engines": { + "node": ">=10" + } + }, + "internal/helpers/node_modules/jest": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/core": "^29.7.0", + "@jest/types": "^29.6.3", + "import-local": "^3.0.2", + "jest-cli": "^29.7.0" + }, + "bin": { + "jest": "bin/jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "internal/helpers/node_modules/jest-changed-files": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "execa": "^5.0.0", + "jest-util": "^29.7.0", + "p-limit": "^3.1.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "internal/helpers/node_modules/jest-circus": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "co": "^4.6.0", + "dedent": "^1.0.0", + "is-generator-fn": "^2.0.0", + "jest-each": "^29.7.0", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "p-limit": "^3.1.0", + "pretty-format": "^29.7.0", + "pure-rand": "^6.0.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "internal/helpers/node_modules/jest-cli": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/core": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "create-jest": "^29.7.0", + "exit": "^0.1.2", + "import-local": "^3.0.2", + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "yargs": "^17.3.1" + }, + "bin": { + "jest": "bin/jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "internal/helpers/node_modules/jest-config": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.11.6", + "@jest/test-sequencer": "^29.7.0", + "@jest/types": "^29.6.3", + "babel-jest": "^29.7.0", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "deepmerge": "^4.2.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-circus": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "micromatch": "^4.0.4", + "parse-json": "^5.2.0", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@types/node": "*", + "ts-node": ">=9.0.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "ts-node": { + "optional": true + } + } + }, + "internal/helpers/node_modules/jest-docblock": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "detect-newline": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "internal/helpers/node_modules/jest-each": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "jest-util": "^29.7.0", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "internal/helpers/node_modules/jest-environment-node": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "internal/helpers/node_modules/jest-haste-map": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@types/graceful-fs": "^4.1.3", + "@types/node": "*", + "anymatch": "^3.0.3", + "fb-watchman": "^2.0.0", + "graceful-fs": "^4.2.9", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", + "micromatch": "^4.0.4", + "walker": "^1.0.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "optionalDependencies": { + "fsevents": "^2.3.2" + } + }, + "internal/helpers/node_modules/jest-leak-detector": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "internal/helpers/node_modules/jest-mock": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "internal/helpers/node_modules/jest-regex-util": { + "version": "29.6.3", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "internal/helpers/node_modules/jest-resolve": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-pnp-resolver": "^1.2.2", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "resolve": "^1.20.0", + "resolve.exports": "^2.0.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "internal/helpers/node_modules/jest-resolve-dependencies": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "jest-regex-util": "^29.6.3", + "jest-snapshot": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "internal/helpers/node_modules/jest-runner": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/console": "^29.7.0", + "@jest/environment": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "emittery": "^0.13.1", + "graceful-fs": "^4.2.9", + "jest-docblock": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-leak-detector": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-resolve": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-util": "^29.7.0", + "jest-watcher": "^29.7.0", + "jest-worker": "^29.7.0", + "p-limit": "^3.1.0", + "source-map-support": "0.5.13" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "internal/helpers/node_modules/jest-runtime": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/globals": "^29.7.0", + "@jest/source-map": "^29.6.3", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "cjs-module-lexer": "^1.0.0", + "collect-v8-coverage": "^1.0.0", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "slash": "^3.0.0", + "strip-bom": "^4.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "internal/helpers/node_modules/jest-snapshot": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.11.6", + "@babel/generator": "^7.7.2", + "@babel/plugin-syntax-jsx": "^7.7.2", + "@babel/plugin-syntax-typescript": "^7.7.2", + "@babel/types": "^7.3.3", + "@jest/expect-utils": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0", + "chalk": "^4.0.0", + "expect": "^29.7.0", + "graceful-fs": "^4.2.9", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "natural-compare": "^1.4.0", + "pretty-format": "^29.7.0", + "semver": "^7.5.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "internal/helpers/node_modules/jest-validate": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "camelcase": "^6.2.0", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "leven": "^3.1.0", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "internal/helpers/node_modules/jest-watcher": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "emittery": "^0.13.1", + "jest-util": "^29.7.0", + "string-length": "^4.0.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "internal/helpers/node_modules/jest-worker": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*", + "jest-util": "^29.7.0", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "internal/helpers/node_modules/minimatch": { + "version": "3.1.2", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "internal/helpers/node_modules/pure-rand": { + "version": "6.1.0", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/dubzzz" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fast-check" + } + ], + "license": "MIT" + }, + "internal/helpers/node_modules/signal-exit": { + "version": "3.0.7", + "dev": true, + "license": "ISC" + }, + "internal/helpers/node_modules/supports-color": { + "version": "8.1.1", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "internal/helpers/node_modules/wrap-ansi": { + "version": "7.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "internal/helpers/node_modules/write-file-atomic": { + "version": "4.0.2", + "dev": true, + "license": "ISC", + "dependencies": { + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.7" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "internal/helpers/node_modules/yargs": { + "version": "17.7.2", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "internal/helpers/node_modules/zod": { + "version": "4.1.12", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, + "lambdas/api-handler": { + "name": "nhs-notify-supplier-api-handler", + "version": "0.0.1", + "dependencies": { + "@internal/datastore": "*", + "@internal/helpers": "*", + "esbuild": "^0.24.0", + "pino": "^9.7.0" + }, + "devDependencies": { + "@aws-sdk/s3-request-presigner": "^3.901.0", + "@tsconfig/node22": "^22.0.2", + "@types/aws-lambda": "^8.10.148", + "@types/jest": "^29.5.14", + "jest": "^29.7.0", + "jest-mock-extended": "^3.0.7", + "typescript": "^5.8.3", + "zod": "^4.1.11" + } + }, + "lambdas/api-handler/node_modules/@jest/core": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/console": "^29.7.0", + "@jest/reporters": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "jest-changed-files": "^29.7.0", + "jest-config": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-resolve-dependencies": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "jest-watcher": "^29.7.0", + "micromatch": "^4.0.4", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "lambdas/api-handler/node_modules/@jest/environment": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "lambdas/api-handler/node_modules/@jest/expect": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "expect": "^29.7.0", + "jest-snapshot": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "lambdas/api-handler/node_modules/@jest/fake-timers": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@sinonjs/fake-timers": "^10.0.2", + "@types/node": "*", + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "lambdas/api-handler/node_modules/@jest/globals": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/types": "^29.6.3", + "jest-mock": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "lambdas/api-handler/node_modules/@jest/reporters": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@bcoe/v8-coverage": "^0.2.3", + "@jest/console": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", + "@types/node": "*", + "chalk": "^4.0.0", + "collect-v8-coverage": "^1.0.0", + "exit": "^0.1.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-instrument": "^6.0.0", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.1.3", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", + "slash": "^3.0.0", + "string-length": "^4.0.1", + "strip-ansi": "^6.0.0", + "v8-to-istanbul": "^9.0.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "lambdas/api-handler/node_modules/@jest/source-map": { + "version": "29.6.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.18", + "callsites": "^3.0.0", + "graceful-fs": "^4.2.9" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "lambdas/api-handler/node_modules/@jest/test-sequencer": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/test-result": "^29.7.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "lambdas/api-handler/node_modules/@jest/transform": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.11.6", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", + "babel-plugin-istanbul": "^6.1.1", + "chalk": "^4.0.0", + "convert-source-map": "^2.0.0", + "fast-json-stable-stringify": "^2.1.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "micromatch": "^4.0.4", + "pirates": "^4.0.4", + "slash": "^3.0.0", + "write-file-atomic": "^4.0.2" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "lambdas/api-handler/node_modules/@sinonjs/fake-timers": { + "version": "10.3.0", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@sinonjs/commons": "^3.0.0" + } + }, + "lambdas/api-handler/node_modules/@types/jest": { + "version": "29.5.14", + "dev": true, + "license": "MIT", + "dependencies": { + "expect": "^29.0.0", + "pretty-format": "^29.0.0" + } + }, + "lambdas/api-handler/node_modules/babel-jest": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/transform": "^29.7.0", + "@types/babel__core": "^7.1.14", + "babel-plugin-istanbul": "^6.1.1", + "babel-preset-jest": "^29.6.3", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.8.0" + } + }, + "lambdas/api-handler/node_modules/babel-plugin-istanbul": { + "version": "6.1.1", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@babel/helper-plugin-utils": "^7.0.0", + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-instrument": "^5.0.4", + "test-exclude": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "lambdas/api-handler/node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument": { + "version": "5.2.1", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@babel/core": "^7.12.3", + "@babel/parser": "^7.14.7", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "lambdas/api-handler/node_modules/babel-plugin-istanbul/node_modules/semver": { + "version": "6.3.1", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "lambdas/api-handler/node_modules/babel-plugin-jest-hoist": { + "version": "29.6.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.3.3", + "@babel/types": "^7.3.3", + "@types/babel__core": "^7.1.14", + "@types/babel__traverse": "^7.0.6" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "lambdas/api-handler/node_modules/babel-preset-jest": { + "version": "29.6.3", + "dev": true, + "license": "MIT", + "dependencies": { + "babel-plugin-jest-hoist": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "lambdas/api-handler/node_modules/brace-expansion": { + "version": "1.1.12", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "lambdas/api-handler/node_modules/camelcase": { + "version": "6.3.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "lambdas/api-handler/node_modules/ci-info": { + "version": "3.9.0", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "lambdas/api-handler/node_modules/cjs-module-lexer": { + "version": "1.4.3", + "dev": true, + "license": "MIT" + }, + "lambdas/api-handler/node_modules/cliui": { + "version": "8.0.1", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "lambdas/api-handler/node_modules/glob": { + "version": "7.2.3", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "lambdas/api-handler/node_modules/istanbul-lib-source-maps": { + "version": "4.0.1", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + }, + "engines": { + "node": ">=10" + } + }, + "lambdas/api-handler/node_modules/jest": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/core": "^29.7.0", + "@jest/types": "^29.6.3", + "import-local": "^3.0.2", + "jest-cli": "^29.7.0" + }, + "bin": { + "jest": "bin/jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "lambdas/api-handler/node_modules/jest-changed-files": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "execa": "^5.0.0", + "jest-util": "^29.7.0", + "p-limit": "^3.1.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "lambdas/api-handler/node_modules/jest-circus": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "co": "^4.6.0", + "dedent": "^1.0.0", + "is-generator-fn": "^2.0.0", + "jest-each": "^29.7.0", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "p-limit": "^3.1.0", + "pretty-format": "^29.7.0", + "pure-rand": "^6.0.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "lambdas/api-handler/node_modules/jest-cli": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/core": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "create-jest": "^29.7.0", + "exit": "^0.1.2", + "import-local": "^3.0.2", + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "yargs": "^17.3.1" + }, + "bin": { + "jest": "bin/jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "lambdas/api-handler/node_modules/jest-config": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.11.6", + "@jest/test-sequencer": "^29.7.0", + "@jest/types": "^29.6.3", + "babel-jest": "^29.7.0", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "deepmerge": "^4.2.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-circus": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "micromatch": "^4.0.4", + "parse-json": "^5.2.0", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@types/node": "*", + "ts-node": ">=9.0.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "ts-node": { + "optional": true + } + } + }, + "lambdas/api-handler/node_modules/jest-docblock": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "detect-newline": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "lambdas/api-handler/node_modules/jest-each": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "jest-util": "^29.7.0", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "lambdas/api-handler/node_modules/jest-environment-node": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "lambdas/api-handler/node_modules/jest-haste-map": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@types/graceful-fs": "^4.1.3", + "@types/node": "*", + "anymatch": "^3.0.3", + "fb-watchman": "^2.0.0", + "graceful-fs": "^4.2.9", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", + "micromatch": "^4.0.4", + "walker": "^1.0.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "optionalDependencies": { + "fsevents": "^2.3.2" + } + }, + "lambdas/api-handler/node_modules/jest-leak-detector": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "lambdas/api-handler/node_modules/jest-mock": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "lambdas/api-handler/node_modules/jest-mock-extended": { + "version": "3.0.7", + "dev": true, + "license": "MIT", + "dependencies": { + "ts-essentials": "^10.0.0" + }, + "peerDependencies": { + "jest": "^24.0.0 || ^25.0.0 || ^26.0.0 || ^27.0.0 || ^28.0.0 || ^29.0.0", + "typescript": "^3.0.0 || ^4.0.0 || ^5.0.0" + } + }, + "lambdas/api-handler/node_modules/jest-regex-util": { + "version": "29.6.3", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "lambdas/api-handler/node_modules/jest-resolve": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-pnp-resolver": "^1.2.2", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "resolve": "^1.20.0", + "resolve.exports": "^2.0.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "lambdas/api-handler/node_modules/jest-resolve-dependencies": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "jest-regex-util": "^29.6.3", + "jest-snapshot": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "lambdas/api-handler/node_modules/jest-runner": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/console": "^29.7.0", + "@jest/environment": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "emittery": "^0.13.1", + "graceful-fs": "^4.2.9", + "jest-docblock": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-leak-detector": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-resolve": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-util": "^29.7.0", + "jest-watcher": "^29.7.0", + "jest-worker": "^29.7.0", + "p-limit": "^3.1.0", + "source-map-support": "0.5.13" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "lambdas/api-handler/node_modules/jest-runtime": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/globals": "^29.7.0", + "@jest/source-map": "^29.6.3", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "cjs-module-lexer": "^1.0.0", + "collect-v8-coverage": "^1.0.0", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "slash": "^3.0.0", + "strip-bom": "^4.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "lambdas/api-handler/node_modules/jest-snapshot": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.11.6", + "@babel/generator": "^7.7.2", + "@babel/plugin-syntax-jsx": "^7.7.2", + "@babel/plugin-syntax-typescript": "^7.7.2", + "@babel/types": "^7.3.3", + "@jest/expect-utils": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0", + "chalk": "^4.0.0", + "expect": "^29.7.0", + "graceful-fs": "^4.2.9", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "natural-compare": "^1.4.0", + "pretty-format": "^29.7.0", + "semver": "^7.5.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "lambdas/api-handler/node_modules/jest-validate": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "camelcase": "^6.2.0", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "leven": "^3.1.0", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "lambdas/api-handler/node_modules/jest-watcher": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "emittery": "^0.13.1", + "jest-util": "^29.7.0", + "string-length": "^4.0.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "lambdas/api-handler/node_modules/jest-worker": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*", + "jest-util": "^29.7.0", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "lambdas/api-handler/node_modules/minimatch": { + "version": "3.1.2", + "dev": true, "license": "ISC", "dependencies": { - "nhsuk-frontend": "^8.1.1" + "brace-expansion": "^1.1.7" }, - "devDependencies": {} + "engines": { + "node": "*" + } }, - "internal/datastore": { - "version": "0.1.0", + "lambdas/api-handler/node_modules/pure-rand": { + "version": "6.1.0", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/dubzzz" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fast-check" + } + ], + "license": "MIT" + }, + "lambdas/api-handler/node_modules/signal-exit": { + "version": "3.0.7", + "dev": true, + "license": "ISC" + }, + "lambdas/api-handler/node_modules/supports-color": { + "version": "8.1.1", + "dev": true, "license": "MIT", "dependencies": { - "@aws-sdk/client-dynamodb": "^3.858.0", - "@aws-sdk/lib-dynamodb": "^3.858.0", - "pino": "^9.7.0", - "zod": "^4.0.14" + "has-flag": "^4.0.0" }, - "devDependencies": { - "@stylistic/eslint-plugin": "^3.1.0", - "@tsconfig/node22": "^22.0.2", - "@types/jest": "^30.0.0", - "@typescript-eslint/eslint-plugin": "^8.46.2", - "@typescript-eslint/parser": "^8.27.0", - "eslint": "^9.27.0", - "eslint-plugin-jest": "^29.0.1", - "jest": "^30.1.3", - "jest-mock-extended": "^4.0.0", - "testcontainers": "^11.4.0", - "ts-jest": "^29.4.0", - "ts-node": "^10.9.2", - "typescript": "^5.8.2", - "zod-mermaid": "^1.0.9" + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" } }, - "lambdas/api-handler": { - "name": "nhs-notify-supplier-api-handler", - "version": "0.0.1", + "lambdas/api-handler/node_modules/wrap-ansi": { + "version": "7.0.0", + "dev": true, + "license": "MIT", "dependencies": { - "esbuild": "^0.24.0" + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" }, - "devDependencies": { - "@aws-sdk/s3-request-presigner": "^3.901.0", - "@tsconfig/node22": "^22.0.2", - "@types/aws-lambda": "^8.10.148", - "@types/jest": "^30.0.0", - "jest": "^30.1.3", - "jest-mock-extended": "^4.0.0", - "typescript": "^5.8.2" + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "lambdas/api-handler/node_modules/write-file-atomic": { + "version": "4.0.2", + "dev": true, + "license": "ISC", + "dependencies": { + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.7" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "lambdas/api-handler/node_modules/yargs": { + "version": "17.7.2", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "lambdas/api-handler/node_modules/zod": { + "version": "4.1.12", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" } }, "lambdas/authorizer": { @@ -121,7 +1959,7 @@ "@types/jest": "^30.0.0", "jest": "^30.1.3", "jest-mock-extended": "^4.0.0", - "typescript": "^5.8.2" + "typescript": "^5.8.3" } }, "node_modules/@ampproject/remapping": { @@ -3306,6 +5144,14 @@ } } }, + "node_modules/@internal/datastore": { + "resolved": "internal/datastore", + "link": true + }, + "node_modules/@internal/helpers": { + "resolved": "internal/helpers", + "link": true + }, "node_modules/@isaacs/balanced-match": { "version": "4.0.1", "dev": true, @@ -3783,8 +5629,6 @@ }, "node_modules/@jest/environment-jsdom-abstract/node_modules/@jest/fake-timers/node_modules/jest-message-util": { "version": "30.0.5", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-30.0.5.tgz", - "integrity": "sha512-NAiDOhsK3V7RU0Aa/HnrQo+E4JlbarbmI3q6Pi4KcxicdtjV82gcIUrejOtczChtVQR4kddu1E1EJlW6EN9IyA==", "dev": true, "license": "MIT", "dependencies": { @@ -9604,10 +11448,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/datastore": { - "resolved": "internal/datastore", - "link": true - }, "node_modules/dateformat": { "version": "3.0.2", "dev": true, @@ -9854,8 +11694,6 @@ }, "node_modules/dockerode/node_modules/tar-fs": { "version": "2.1.4", - "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.4.tgz", - "integrity": "sha512-mDAjwmZdh7LTT6pNleZ05Yt65HC3E+NiQzl672vQG38jIrehtJk/J3mNwIg+vShQPcLF/LV7CMnDW6vjj6sfYQ==", "dev": true, "license": "MIT", "dependencies": { @@ -10722,8 +12560,6 @@ }, "node_modules/eslint-plugin-jest": { "version": "29.0.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-29.0.1.tgz", - "integrity": "sha512-EE44T0OSMCeXhDrrdsbKAhprobKkPtJTbQz5yEktysNpHeDZTAL1SfDTNKmcFfJkY6yrQLtTKZALrD3j/Gpmiw==", "dev": true, "license": "MIT", "dependencies": { @@ -13971,8 +15807,6 @@ }, "node_modules/jest-html-reporter": { "version": "4.3.0", - "resolved": "https://registry.npmjs.org/jest-html-reporter/-/jest-html-reporter-4.3.0.tgz", - "integrity": "sha512-lq4Zx35yc6Ehw513CXJ1ok3wUmkSiOImWcyLAmylfzrz7DAqtrhDF9V73F4qfstmGxlr8X0QrEjWsl/oqhf4sQ==", "dev": true, "license": "MIT", "dependencies": { @@ -13994,8 +15828,6 @@ }, "node_modules/jest-html-reporter/node_modules/@jest/console": { "version": "30.2.0", - "resolved": "https://registry.npmjs.org/@jest/console/-/console-30.2.0.tgz", - "integrity": "sha512-+O1ifRjkvYIkBqASKWgLxrpEhQAAE7hY77ALLUufSk5717KfOShg6IbqLmdsLMPdUiFvA2kTs0R7YZy+l0IzZQ==", "dev": true, "license": "MIT", "dependencies": { @@ -14012,8 +15844,6 @@ }, "node_modules/jest-html-reporter/node_modules/@jest/schemas": { "version": "30.0.5", - "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-30.0.5.tgz", - "integrity": "sha512-DmdYgtezMkh3cpU8/1uyXakv3tJRcmcXxBOcO0tbaozPwpmh4YMsnWrQm9ZmZMfa5ocbxzbFk6O4bDPEc/iAnA==", "dev": true, "license": "MIT", "dependencies": { @@ -14025,8 +15855,6 @@ }, "node_modules/jest-html-reporter/node_modules/@jest/test-result": { "version": "30.2.0", - "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-30.2.0.tgz", - "integrity": "sha512-RF+Z+0CCHkARz5HT9mcQCBulb1wgCP3FBvl9VFokMX27acKphwyQsNuWH3c+ojd1LeWBLoTYoxF0zm6S/66mjg==", "dev": true, "license": "MIT", "dependencies": { @@ -14041,8 +15869,6 @@ }, "node_modules/jest-html-reporter/node_modules/@jest/types": { "version": "30.2.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-30.2.0.tgz", - "integrity": "sha512-H9xg1/sfVvyfU7o3zMfBEjQ1gcsdeTMgqHoYdN79tuLqfTtuu7WckRA1R5whDwOzxaZAeMKTYWqP+WCAi0CHsg==", "dev": true, "license": "MIT", "dependencies": { @@ -14060,15 +15886,11 @@ }, "node_modules/jest-html-reporter/node_modules/@sinclair/typebox": { "version": "0.34.41", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.34.41.tgz", - "integrity": "sha512-6gS8pZzSXdyRHTIqoqSVknxolr1kzfy4/CeDnrzsVz8TTIWUbOBr6gnzOmTYJ3eXQNh4IYHIGi5aIL7sOZ2G/g==", "dev": true, "license": "MIT" }, "node_modules/jest-html-reporter/node_modules/ansi-styles": { "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", "dev": true, "license": "MIT", "engines": { @@ -14080,8 +15902,6 @@ }, "node_modules/jest-html-reporter/node_modules/jest-message-util": { "version": "30.2.0", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-30.2.0.tgz", - "integrity": "sha512-y4DKFLZ2y6DxTWD4cDe07RglV88ZiNEdlRfGtqahfbIjfsw1nMCPx49Uev4IA/hWn3sDKyAnSPwoYSsAEdcimw==", "dev": true, "license": "MIT", "dependencies": { @@ -14101,8 +15921,6 @@ }, "node_modules/jest-html-reporter/node_modules/jest-util": { "version": "30.2.0", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-30.2.0.tgz", - "integrity": "sha512-QKNsM0o3Xe6ISQU869e+DhG+4CK/48aHYdJZGlFQVTjnbvgpcKyxpzk29fGiO7i/J8VENZ+d2iGnSsvmuHywlA==", "dev": true, "license": "MIT", "dependencies": { @@ -14119,8 +15937,6 @@ }, "node_modules/jest-html-reporter/node_modules/picomatch": { "version": "4.0.3", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", - "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "dev": true, "license": "MIT", "engines": { @@ -14132,8 +15948,6 @@ }, "node_modules/jest-html-reporter/node_modules/pretty-format": { "version": "30.2.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-30.2.0.tgz", - "integrity": "sha512-9uBdv/B4EefsuAL+pWqueZyZS2Ba+LxfFeQ9DN14HU4bN8bhaxKdkpjpB6fs9+pSjIBu+FXQHImEg8j/Lw0+vA==", "dev": true, "license": "MIT", "dependencies": { @@ -14245,8 +16059,6 @@ }, "node_modules/jest-mock-extended": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jest-mock-extended/-/jest-mock-extended-4.0.0.tgz", - "integrity": "sha512-7BZpfuvLam+/HC+NxifIi9b+5VXj/utUDMPUqrDJehGWVuXPtLS9Jqlob2mJLrI/pg2k1S8DMfKDvEB88QNjaQ==", "dev": true, "license": "MIT", "dependencies": { @@ -18668,8 +20480,6 @@ }, "node_modules/tar-fs": { "version": "3.1.1", - "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.1.1.tgz", - "integrity": "sha512-LZA0oaPOc2fVo82Txf3gw+AkEd38szODlptMYejQUhndHMLQ9M059uXR+AfS7DNo0NpINvSqDsvyaCrBVkptWg==", "dev": true, "license": "MIT", "dependencies": { @@ -19990,6 +21800,7 @@ }, "node_modules/zod": { "version": "4.0.17", + "dev": true, "license": "MIT", "funding": { "url": "https://github.com/sponsors/colinhacks" @@ -20011,6 +21822,7 @@ "version": "0.0.1", "dependencies": { "@aws-sdk/client-s3": "^3.858.0", + "@internal/datastore": "*", "esbuild": "^0.24.0", "pino": "^9.7.0", "yargs": "^17.7.2" @@ -20020,7 +21832,7 @@ "@types/jest": "^30.0.0", "jest": "^30.1.3", "jest-mock-extended": "^4.0.0", - "typescript": "^5.8.2" + "typescript": "^5.8.3" } }, "scripts/test-data/node_modules/@jest/core": { diff --git a/package.json b/package.json index e690c092..26146a6f 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "jest-mock-extended": "^4.0.0", "lcov-result-merger": "^5.0.1", "openapi-typescript": "^7.8.0", - "ts-jest": "^29.3.0", + "ts-jest": "^29.4.0", "ts-node": "^10.9.2", "tsx": "^4.19.3", "typescript": "^5.8.3" @@ -72,12 +72,13 @@ "serve-swagger-docs": "npx serve sdk/swagger -p 3051", "start": "npm run start --workspace frontend", "test:unit": "npm run test:unit --workspaces", - "typecheck": "npm run typecheck --workspaces" + "typecheck": "npm run typecheck --workspaces", + "deps:sync": "npx syncpack fix-mismatches", + "deps:check": "npx syncpack list-mismatches" }, "workspaces": [ - "lambdas/api-handler", - "lambdas/authorizer", - "internal/datastore", + "lambdas/*", + "internal/*", "scripts/test-data", "docs" ] diff --git a/scripts/config/.repository-template-sync-ignore b/scripts/config/.repository-template-sync-ignore index 7b6cbfc1..3853c525 100644 --- a/scripts/config/.repository-template-sync-ignore +++ b/scripts/config/.repository-template-sync-ignore @@ -14,6 +14,7 @@ CHANGELOG.md project.code-workspace README.md scripts/config/sonar-scanner.properties +scripts/githooks/check-markdown-format.sh scripts/tests/ VERSION diff --git a/scripts/config/markdownlint.yaml b/scripts/config/markdownlint.yaml deleted file mode 100644 index 9f92b8da..00000000 --- a/scripts/config/markdownlint.yaml +++ /dev/null @@ -1,14 +0,0 @@ -# SEE: https://github.com/DavidAnson/markdownlint/blob/main/schema/.markdownlint.yaml - -# https://github.com/DavidAnson/markdownlint/blob/main/doc/md013.md -MD013: false - -# https://github.com/DavidAnson/markdownlint/blob/main/doc/md024.md -MD024: - siblings_only: true - -# https://github.com/DavidAnson/markdownlint/blob/main/doc/md033.md -MD033: false - -MD041: - level: 2 diff --git a/scripts/config/vale/styles/config/vocabularies/words/accept.txt b/scripts/config/vale/styles/config/vocabularies/words/accept.txt index a82759ca..9e5119ba 100644 --- a/scripts/config/vale/styles/config/vocabularies/words/accept.txt +++ b/scripts/config/vale/styles/config/vocabularies/words/accept.txt @@ -31,6 +31,7 @@ relative_url repo SDK sed +semver src Syft Terraform diff --git a/scripts/githooks/check-markdown-format.sh b/scripts/githooks/check-markdown-format.sh index c39a080d..24de75fb 100755 --- a/scripts/githooks/check-markdown-format.sh +++ b/scripts/githooks/check-markdown-format.sh @@ -51,11 +51,22 @@ function main() { ;; esac - if [ -n "$files" ]; then + specfiles=$(echo "$files" | grep '^specification/') || true + otherfiles=$(echo "$files" | grep -v '^specification/') || true + + if [ -n "$specfiles" ]; then + if command -v markdownlint > /dev/null 2>&1 && ! is-arg-true "${FORCE_USE_DOCKER:-false}"; then + files="$specfiles" config="specification/.markdownlint.json" run-markdownlint-natively + else + files="$specfiles" config="specification/.markdownlint.json" run-markdownlint-in-docker + fi + fi + + if [ -n "$otherfiles" ]; then if command -v markdownlint > /dev/null 2>&1 && ! is-arg-true "${FORCE_USE_DOCKER:-false}"; then - files="$files" run-markdownlint-natively + files="$otherfiles" config=".markdownlint.jsonc" run-markdownlint-natively else - files="$files" run-markdownlint-in-docker + files="$otherfiles" config=".markdownlint.jsonc" run-markdownlint-in-docker fi fi } @@ -63,17 +74,19 @@ function main() { # Run markdownlint natively. # Arguments (provided as environment variables): # files=[files to check] +# config=[path to config file] function run-markdownlint-natively() { # shellcheck disable=SC2086 markdownlint \ $files \ - --config "$PWD/scripts/config/markdownlint.yaml" + --config "$config" } # Run markdownlint in a Docker container. # Arguments (provided as environment variables): # files=[files to check] +# config=[path to config file] function run-markdownlint-in-docker() { # shellcheck disable=SC1091 @@ -86,7 +99,7 @@ function run-markdownlint-in-docker() { --volume "$PWD":/workdir \ "$image" \ $files \ - --config /workdir/scripts/config/markdownlint.yaml + --config "$config" } # ============================================================================== diff --git a/scripts/test-data/package.json b/scripts/test-data/package.json index b2f6762a..75f92e5a 100644 --- a/scripts/test-data/package.json +++ b/scripts/test-data/package.json @@ -1,6 +1,7 @@ { "dependencies": { "@aws-sdk/client-s3": "^3.858.0", + "@internal/datastore": "*", "esbuild": "^0.24.0", "pino": "^9.7.0", "yargs": "^17.7.2" @@ -10,7 +11,7 @@ "@types/jest": "^30.0.0", "jest": "^30.1.3", "jest-mock-extended": "^4.0.0", - "typescript": "^5.8.2" + "typescript": "^5.8.3" }, "name": "nhs-notify-supplier-api-data-generator", "private": true, diff --git a/scripts/test-data/src/__test__/helpers/create_letter_helpers.test.ts b/scripts/test-data/src/__test__/helpers/create_letter_helpers.test.ts index 135e46b7..a8b2a0db 100644 --- a/scripts/test-data/src/__test__/helpers/create_letter_helpers.test.ts +++ b/scripts/test-data/src/__test__/helpers/create_letter_helpers.test.ts @@ -1,5 +1,5 @@ -import { LetterRepository } from "../../../../../internal/datastore/src/letter-repository"; -import { LetterStatusType } from "../../../../../internal/datastore/src/types"; +import { LetterRepository } from "@internal/datastore/src/letter-repository"; +import { LetterStatusType } from "@internal/datastore"; import { createLetter, createLetterDto } from "../../helpers/create_letter_helpers"; import { uploadFile } from "../../helpers/s3_helpers"; diff --git a/scripts/test-data/src/cli/index.ts b/scripts/test-data/src/cli/index.ts index 9454e1e3..0e2a4517 100644 --- a/scripts/test-data/src/cli/index.ts +++ b/scripts/test-data/src/cli/index.ts @@ -1,13 +1,10 @@ import { hideBin } from "yargs/helpers"; import yargs from "yargs/yargs"; -import { - LetterStatusType, -} from "../../../../internal/datastore/src/types"; +import { LetterStatusType } from "@internal/datastore/src/types"; import { randomUUID } from "crypto"; import { createLetter, createLetterDto } from "../helpers/create_letter_helpers"; import { createLetterRepository } from "../infrastructure/letter-repo-factory"; import { uploadFile } from "../helpers/s3_helpers"; -import { Console } from "console"; async function main() { await yargs(hideBin(process.argv)) diff --git a/scripts/test-data/src/helpers/create_letter_helpers.ts b/scripts/test-data/src/helpers/create_letter_helpers.ts index 6af4d0db..e1eb0719 100644 --- a/scripts/test-data/src/helpers/create_letter_helpers.ts +++ b/scripts/test-data/src/helpers/create_letter_helpers.ts @@ -1,8 +1,8 @@ -import { LetterRepository } from "../../../../internal/datastore/src/letter-repository"; import { + LetterRepository, Letter, LetterStatusType, -} from "../../../../internal/datastore/src/types"; +} from "@internal/datastore"; import { uploadFile } from "./s3_helpers"; export async function createLetter(params: { diff --git a/scripts/test-data/src/infrastructure/letter-repo-factory.ts b/scripts/test-data/src/infrastructure/letter-repo-factory.ts index 0074c9fc..269642c0 100644 --- a/scripts/test-data/src/infrastructure/letter-repo-factory.ts +++ b/scripts/test-data/src/infrastructure/letter-repo-factory.ts @@ -1,7 +1,7 @@ import { DynamoDBClient } from '@aws-sdk/client-dynamodb'; import { DynamoDBDocumentClient } from '@aws-sdk/lib-dynamodb'; import pino from 'pino'; -import { LetterRepository } from '../../../../internal/datastore'; +import { LetterRepository } from '@internal/datastore'; export function createLetterRepository(environment: string, ttlHours:number): LetterRepository { const ddbClient = new DynamoDBClient({}); diff --git a/scripts/test-data/tsconfig.json b/scripts/test-data/tsconfig.json index a08833f4..24902365 100644 --- a/scripts/test-data/tsconfig.json +++ b/scripts/test-data/tsconfig.json @@ -1,8 +1,6 @@ { - "compilerOptions": { - "isolatedModules": true - }, - "extends": "@tsconfig/node22/tsconfig.json", + "compilerOptions": {}, + "extends": "../../tsconfig.base.json", "include": [ "src/**/*", "jest.config.ts" diff --git a/specification/.markdownlint.json b/specification/.markdownlint.json new file mode 100644 index 00000000..d4221b27 --- /dev/null +++ b/specification/.markdownlint.json @@ -0,0 +1,6 @@ +{ + "MD041": { + "level": 2 + }, + "extends": "../.markdownlint.jsonc" +} diff --git a/tsconfig.base.json b/tsconfig.base.json new file mode 100644 index 00000000..b340a8fa --- /dev/null +++ b/tsconfig.base.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "baseUrl": ".", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + "module": "ES2020", + "moduleResolution": "node", + "noEmit": true, + "skipLibCheck": true, + "strict": true, + "target": "ES2022" + }, + "extends": "@tsconfig/node22/tsconfig.json" +}