Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move top level modules into utils #2604

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion _templates/new-lambda/api-gateway/jest.config.ejs.t
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,5 @@ module.exports = {
runner: 'groups',
moduleNameMapper: {
'@modules/(.*)/(.*)$': '<rootDir>/../../modules/$1/src/$2',
'@modules/(.*)$': '<rootDir>/../../modules/$1',
},
};
1 change: 0 additions & 1 deletion handlers/alarms-handler/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ module.exports = {
runner: 'groups',
moduleNameMapper: {
'@modules/(.*)/(.*)$': '<rootDir>/../../modules/$1/src/$2',
'@modules/(.*)$': '<rootDir>/../../modules/$1',
},
};
2 changes: 1 addition & 1 deletion handlers/alarms-handler/src/alarmMappings.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getIfDefined } from '@modules/nullAndUndefined';
import { getIfDefined } from '@modules/utils/nullAndUndefined';

type Team = 'VALUE' | 'GROWTH' | 'PORTFOLIO' | 'PLATFORM' | 'SRE';

Expand Down
2 changes: 1 addition & 1 deletion handlers/alarms-handler/src/cloudwatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
} from '@aws-sdk/client-cloudwatch';
import type { Tag } from '@aws-sdk/client-cloudwatch';
import { fromTemporaryCredentials } from '@aws-sdk/credential-providers';
import { getIfDefined } from '@modules/nullAndUndefined';
import { getIfDefined } from '@modules/utils/nullAndUndefined';

const buildCrossAccountCloudwatchClient = (roleArn: string) => {
const credentials = fromTemporaryCredentials({
Expand Down
1 change: 0 additions & 1 deletion handlers/discount-api/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ module.exports = {
runner: 'groups',
moduleNameMapper: {
'@modules/(.*)/(.*)$': '<rootDir>/../../modules/$1/src/$2',
'@modules/(.*)$': '<rootDir>/../../modules/$1',
},
};
10 changes: 5 additions & 5 deletions handlers/discount-api/src/discountEndpoint.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { sum } from '@modules/arrayFunctions';
import { ValidationError } from '@modules/errors';
import { Lazy } from '@modules/lazy';
import { getIfDefined } from '@modules/nullAndUndefined';
import type { Stage } from '@modules/stage';
import { sum } from '@modules/utils/arrayFunctions';
import { ValidationError } from '@modules/utils/errors';
import { Lazy } from '@modules/utils/lazy';
import { getIfDefined } from '@modules/utils/nullAndUndefined';
import type { Stage } from '@modules/utils/stage';
import { addDiscount, previewDiscount } from '@modules/zuora/addDiscount';
import {
billingPreviewToSimpleInvoiceItems,
Expand Down
4 changes: 2 additions & 2 deletions handlers/discount-api/src/eligibilityChecker.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ValidationError } from '@modules/errors';
import { getIfDefined } from '@modules/nullAndUndefined';
import { ValidationError } from '@modules/utils/errors';
import { getIfDefined } from '@modules/utils/nullAndUndefined';
import type { SimpleInvoiceItem } from '@modules/zuora/billingPreview';
import { getNextInvoiceTotal } from '@modules/zuora/billingPreview';
import type { Logger } from '@modules/zuora/logger';
Expand Down
6 changes: 3 additions & 3 deletions handlers/discount-api/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { sendEmail } from '@modules/email/email';
import { ValidationError } from '@modules/errors';
import { getIfDefined } from '@modules/nullAndUndefined';
import type { Stage } from '@modules/stage';
import { ValidationError } from '@modules/utils/errors';
import { getIfDefined } from '@modules/utils/nullAndUndefined';
import type { Stage } from '@modules/utils/stage';
import { Logger } from '@modules/zuora/logger';
import type {
APIGatewayProxyEvent,
Expand Down
6 changes: 3 additions & 3 deletions handlers/discount-api/src/productToDiscountMapping.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { getSingleOrThrow } from '@modules/arrayFunctions';
import type { DataExtensionName } from '@modules/email/email';
import { DataExtensionNames } from '@modules/email/email';
import { ValidationError } from '@modules/errors';
import type { Stage } from '@modules/stage';
import { getSingleOrThrow } from '@modules/utils/arrayFunctions';
import { ValidationError } from '@modules/utils/errors';
import type { Stage } from '@modules/utils/stage';
import { isNotRemovedOrDiscount } from '@modules/zuora/rateplan';
import type { ZuoraSubscription } from '@modules/zuora/zuoraSchemas';

Expand Down
2 changes: 1 addition & 1 deletion handlers/discount-api/test/addDiscountIntegration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @group integration
*/

import type { Stage } from '@modules/stage';
import type { Stage } from '@modules/utils/stage';
import { addDiscount } from '@modules/zuora/addDiscount';
import { getSubscription } from '@modules/zuora/getSubscription';
import { ZuoraClient } from '@modules/zuora/zuoraClient';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @group integration
*/
import type { EmailMessageWithUserId } from '@modules/email/email';
import type { Stage } from '@modules/stage';
import type { Stage } from '@modules/utils/stage';
import { cancelSubscription } from '@modules/zuora/cancelSubscription';
import { zuoraDateFormat } from '@modules/zuora/common';
import { Logger } from '@modules/zuora/logger';
Expand Down
2 changes: 1 addition & 1 deletion handlers/discount-api/test/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getIfDefined } from '@modules/nullAndUndefined';
import { getIfDefined } from '@modules/utils/nullAndUndefined';
import type { ZuoraClient } from '@modules/zuora/zuoraClient';
import type {
ZuoraSubscribeResponse,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @group integration
*/
import type { Stage } from '@modules/stage';
import type { Stage } from '@modules/utils/stage';
import { cancelSubscription } from '@modules/zuora/cancelSubscription';
import { zuoraDateFormat } from '@modules/zuora/common';
import { Logger } from '@modules/zuora/logger';
Expand Down
1 change: 0 additions & 1 deletion handlers/generate-product-catalog/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ module.exports = {
runner: 'groups',
moduleNameMapper: {
'@modules/(.*)/(.*)$': '<rootDir>/../../modules/$1/src/$2',
'@modules/(.*)$': '<rootDir>/../../modules/$1',
},
};
4 changes: 2 additions & 2 deletions handlers/generate-product-catalog/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { PutObjectCommand, S3Client } from '@aws-sdk/client-s3';
import { awsConfig } from '@modules/aws/config';
import { generateProductCatalog } from '@modules/product-catalog/generateProductCatalog';
import type { Stage } from '@modules/stage';
import { stageFromEnvironment } from '@modules/stage';
import type { Stage } from '@modules/utils/stage';
import { stageFromEnvironment } from '@modules/utils/stage';
import { getZuoraCatalogFromS3 } from '@modules/zuora-catalog/S3';
import type { Handler, S3CreateEvent } from 'aws-lambda';

Expand Down
1 change: 0 additions & 1 deletion handlers/press-reader-entitlements/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ module.exports = {
runner: 'groups',
moduleNameMapper: {
'@modules/(.*)/(.*)$': '<rootDir>/../../modules/$1/src/$2',
'@modules/(.*)$': '<rootDir>/../../modules/$1',
},
};
process.env = Object.assign(process.env, {
Expand Down
6 changes: 3 additions & 3 deletions handlers/press-reader-entitlements/src/identity.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { GetParameterCommand, SSMClient } from '@aws-sdk/client-ssm';
import { awsConfig } from '@modules/aws/config';
import { ValidationError } from '@modules/errors';
import { ValidationError } from '@modules/utils/errors';
import type { IdentityUserDetails } from '@modules/identity/identity';

Check failure on line 4 in handlers/press-reader-entitlements/src/identity.ts

View workflow job for this annotation

GitHub Actions / gu-cdk-build (press-reader-entitlements)

`@modules/identity/identity` type import should occur before import of `@modules/utils/errors`
import { getIfDefined } from '@modules/nullAndUndefined';
import type { Stage } from '@modules/stage';
import { getIfDefined } from '@modules/utils/nullAndUndefined';
import type { Stage } from '@modules/utils/stage';
import { getUserDetailsSchema } from './schemas';

export const getClientAccessToken = async (stage: Stage) => {
Expand Down
8 changes: 4 additions & 4 deletions handlers/press-reader-entitlements/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Lazy } from '@modules/lazy';
import { getIfDefined } from '@modules/nullAndUndefined';
import { Lazy } from '@modules/utils/lazy';
import { getIfDefined } from '@modules/utils/nullAndUndefined';
import { userHasGuardianEmail } from '@modules/product-benefits/userBenefits';

Check failure on line 3 in handlers/press-reader-entitlements/src/index.ts

View workflow job for this annotation

GitHub Actions / gu-cdk-build (press-reader-entitlements)

`@modules/product-benefits/userBenefits` import should occur before import of `@modules/utils/lazy`
import { getProductCatalogFromApi } from '@modules/product-catalog/api';

Check failure on line 4 in handlers/press-reader-entitlements/src/index.ts

View workflow job for this annotation

GitHub Actions / gu-cdk-build (press-reader-entitlements)

`@modules/product-catalog/api` import should occur before import of `@modules/utils/lazy`
import { Router } from '@modules/routing/router';

Check failure on line 5 in handlers/press-reader-entitlements/src/index.ts

View workflow job for this annotation

GitHub Actions / gu-cdk-build (press-reader-entitlements)

`@modules/routing/router` import should occur before import of `@modules/utils/lazy`
import type { Stage } from '@modules/stage';
import { stageFromEnvironment } from '@modules/stage';
import type { Stage } from '@modules/utils/stage';
import { stageFromEnvironment } from '@modules/utils/stage';
import type { SupporterRatePlanItem } from '@modules/supporter-product-data/supporterProductData';

Check failure on line 8 in handlers/press-reader-entitlements/src/index.ts

View workflow job for this annotation

GitHub Actions / gu-cdk-build (press-reader-entitlements)

`@modules/supporter-product-data/supporterProductData` type import should occur before import of `@modules/utils/lazy`
import type {
APIGatewayProxyEvent,
APIGatewayProxyResult,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { sortBy } from '@modules/arrayFunctions';
import { sortBy } from '@modules/utils/arrayFunctions';

Check failure on line 1 in handlers/press-reader-entitlements/src/supporterProductData.ts

View workflow job for this annotation

GitHub Actions / gu-cdk-build (press-reader-entitlements)

`@modules/utils/arrayFunctions` import should occur after import of `@modules/supporter-product-data/supporterProductData`
import type {
ProductCatalog,
ProductKey,
} from '@modules/product-catalog/productCatalog';
import { ProductCatalogHelper } from '@modules/product-catalog/productCatalog';
import type { Stage } from '@modules/stage';
import type { Stage } from '@modules/utils/stage';

Check failure on line 7 in handlers/press-reader-entitlements/src/supporterProductData.ts

View workflow job for this annotation

GitHub Actions / gu-cdk-build (press-reader-entitlements)

`@modules/utils/stage` type import should occur after import of `@modules/supporter-product-data/supporterProductData`
import type { SupporterRatePlanItem } from '@modules/supporter-product-data/supporterProductData';
import { getSupporterProductData } from '@modules/supporter-product-data/supporterProductData';

Expand Down
1 change: 0 additions & 1 deletion handlers/product-switch-api/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ module.exports = {
runner: 'groups',
moduleNameMapper: {
'@modules/(.*)/(.*)$': '<rootDir>/../../modules/$1/src/$2',
'@modules/(.*)$': '<rootDir>/../../modules/$1',
},
};
4 changes: 2 additions & 2 deletions handlers/product-switch-api/src/catalogInformation.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { BillingPeriod } from '@modules/billingPeriod';
import type { BillingPeriod } from '@modules/utils/billingPeriod';
import type { Currency } from '@modules/internationalisation/currency';

Check failure on line 2 in handlers/product-switch-api/src/catalogInformation.ts

View workflow job for this annotation

GitHub Actions / gu-cdk-build (product-switch-api)

`@modules/internationalisation/currency` type import should occur before type import of `@modules/utils/billingPeriod`
import { getIfDefined } from '@modules/nullAndUndefined';
import { getIfDefined } from '@modules/utils/nullAndUndefined';
import type { ProductCatalog } from '@modules/product-catalog/productCatalog';

Check failure on line 4 in handlers/product-switch-api/src/catalogInformation.ts

View workflow job for this annotation

GitHub Actions / gu-cdk-build (product-switch-api)

`@modules/product-catalog/productCatalog` type import should occur before type import of `@modules/utils/billingPeriod`

export type CatalogInformation = {
supporterPlus: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getIfDefined } from '@modules/nullAndUndefined';
import { getIfDefined } from '@modules/utils/nullAndUndefined';
import { zuoraDateFormat } from '@modules/zuora/common';
import type {
ChangePlanOrderAction,
Expand Down
6 changes: 3 additions & 3 deletions handlers/product-switch-api/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ValidationError } from '@modules/errors';
import { getIfDefined } from '@modules/nullAndUndefined';
import type { Stage } from '@modules/stage';
import { ValidationError } from '@modules/utils/errors';
import { getIfDefined } from '@modules/utils/nullAndUndefined';
import type { Stage } from '@modules/utils/stage';
import type {
APIGatewayProxyEvent,
APIGatewayProxyResult,
Expand Down
2 changes: 1 addition & 1 deletion handlers/product-switch-api/src/payment.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getIfDefined } from '@modules/nullAndUndefined';
import { getIfDefined } from '@modules/utils/nullAndUndefined';
import {
creditInvoice,
getInvoice,
Expand Down
2 changes: 1 addition & 1 deletion handlers/product-switch-api/src/productSwitchEmail.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { BillingPeriod } from '@modules/billingPeriod';
import type { BillingPeriod } from '@modules/utils/billingPeriod';

Check failure on line 1 in handlers/product-switch-api/src/productSwitchEmail.ts

View workflow job for this annotation

GitHub Actions / gu-cdk-build (product-switch-api)

`@modules/utils/billingPeriod` type import should occur after import of `@modules/internationalisation/currency`
import type { EmailMessageWithUserId } from '@modules/email/email';
import { DataExtensionNames, sendEmail } from '@modules/email/email';
import type { Currency } from '@modules/internationalisation/currency';
Expand Down
6 changes: 3 additions & 3 deletions handlers/product-switch-api/src/productSwitchEndpoint.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { getIfDefined } from '@modules/nullAndUndefined';
import { prettyPrint } from '@modules/prettyPrint';
import { getProductCatalogFromApi } from '@modules/product-catalog/api';
import type { Stage } from '@modules/stage';
import { getIfDefined } from '@modules/utils/nullAndUndefined';
import { prettyPrint } from '@modules/utils/prettyPrint';
import type { Stage } from '@modules/utils/stage';
import { getAccount } from '@modules/zuora/getAccount';
import { getSubscription } from '@modules/zuora/getSubscription';
import { ZuoraClient } from '@modules/zuora/zuoraClient';
Expand Down
2 changes: 1 addition & 1 deletion handlers/product-switch-api/src/salesforceTracking.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { SendMessageCommand, SQSClient } from '@aws-sdk/client-sqs';
import { awsConfig } from '@modules/aws/config';
import { prettyPrint } from '@modules/prettyPrint';
import { prettyPrint } from '@modules/utils/prettyPrint';
import type { SwitchInformation } from './switchInformation';

export type SalesforceTrackingInput = {
Expand Down
2 changes: 1 addition & 1 deletion handlers/product-switch-api/src/supporterProductData.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { SendMessageCommand, SQSClient } from '@aws-sdk/client-sqs';
import { awsConfig } from '@modules/aws/config';
import { prettyPrint } from '@modules/prettyPrint';
import { prettyPrint } from '@modules/utils/prettyPrint';
import { zuoraDateFormat } from '@modules/zuora/common';
import dayjs from 'dayjs';
import type { SwitchInformation } from './switchInformation';
Expand Down
10 changes: 5 additions & 5 deletions handlers/product-switch-api/src/switchInformation.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type { BillingPeriod } from '@modules/billingPeriod';
import { ValidationError } from '@modules/errors';
import type { BillingPeriod } from '@modules/utils/billingPeriod';
import { ValidationError } from '@modules/utils/errors';
import type { Currency } from '@modules/internationalisation/currency';

Check failure on line 3 in handlers/product-switch-api/src/switchInformation.ts

View workflow job for this annotation

GitHub Actions / gu-cdk-build (product-switch-api)

`@modules/internationalisation/currency` type import should occur before type import of `@modules/utils/billingPeriod`
import { isSupportedCurrency } from '@modules/internationalisation/currency';

Check failure on line 4 in handlers/product-switch-api/src/switchInformation.ts

View workflow job for this annotation

GitHub Actions / gu-cdk-build (product-switch-api)

`@modules/internationalisation/currency` import should occur before type import of `@modules/utils/billingPeriod`
import { getIfDefined } from '@modules/nullAndUndefined';
import { prettyPrint } from '@modules/prettyPrint';
import { getIfDefined } from '@modules/utils/nullAndUndefined';
import { prettyPrint } from '@modules/utils/prettyPrint';
import type { ProductCatalog } from '@modules/product-catalog/productCatalog';

Check failure on line 7 in handlers/product-switch-api/src/switchInformation.ts

View workflow job for this annotation

GitHub Actions / gu-cdk-build (product-switch-api)

`@modules/product-catalog/productCatalog` type import should occur before type import of `@modules/utils/billingPeriod`
import type { Stage } from '@modules/stage';
import type { Stage } from '@modules/utils/stage';
import type {
RatePlan,
ZuoraAccount,
Expand Down
2 changes: 1 addition & 1 deletion handlers/product-switch-api/src/urlParsing.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getIfDefined } from '@modules/nullAndUndefined';
import { getIfDefined } from '@modules/utils/nullAndUndefined';

const regex =
/\/product-move\/(recurring-contribution-to-supporter-plus)\/(A-S\d+)/;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
*/
import type { EmailMessageWithUserId } from '@modules/email/email';
import { ValidationError } from '@modules/errors';
import { ValidationError } from '@modules/utils/errors';

Check failure on line 6 in handlers/product-switch-api/test/contributionToSupporterPlus.test.ts

View workflow job for this annotation

GitHub Actions / gu-cdk-build (product-switch-api)

`@modules/utils/errors` import should occur after type import of `@modules/product-catalog/productCatalog`
import { generateProductCatalog } from '@modules/product-catalog/generateProductCatalog';
import type { ProductCatalog } from '@modules/product-catalog/productCatalog';
import type { ZuoraSubscription } from '@modules/zuora/zuoraSchemas';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ module.exports = {
runner: 'groups',
moduleNameMapper: {
'@modules/(.*)/(.*)$': '<rootDir>/../../modules/$1/src/$2',
'@modules/(.*)$': '<rootDir>/../../modules/$1',
},
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getIfDefined } from '@modules/nullAndUndefined';
import { getIfDefined } from '@modules/utils/nullAndUndefined';
import { publishSnsMessage } from '../services/sns';
import { describeExecution, startExecution } from '../services/step-functions';

Expand Down
1 change: 0 additions & 1 deletion handlers/salesforce-disaster-recovery/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ module.exports = {
runner: 'groups',
moduleNameMapper: {
'@modules/(.*)/(.*)$': '<rootDir>/../../modules/$1/src/$2',
'@modules/(.*)$': '<rootDir>/../../modules/$1',
},
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getIfDefined } from '@modules/nullAndUndefined';
import { getIfDefined } from '@modules/utils/nullAndUndefined';
import {
type AccountRowWithResult,
convertArrayToCsv,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getIfDefined } from '@modules/nullAndUndefined';
import { getIfDefined } from '@modules/utils/nullAndUndefined';
import {
generateSalesforceAccessToken,
getSalesforceQueryResult,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getIfDefined } from '@modules/nullAndUndefined';
import { type Stage } from '@modules/stage';
import { getIfDefined } from '@modules/utils/nullAndUndefined';
import { type Stage } from '@modules/utils/stage';
import { ZuoraClient } from '@modules/zuora/zuoraClient';
import {
type AccountRow,
Expand Down
3 changes: 1 addition & 2 deletions handlers/ticket-tailor-webhook/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ module.exports = {
testEnvironment: 'node',
runner: 'groups',
moduleNameMapper: {
'@modules/(.*)/src/(.*)$': '<rootDir>/../../modules/$1/src/$2',
'@modules/(.*)$': '<rootDir>/../../modules/$1',
'@modules/(.*)/(.*)$': '<rootDir>/../../modules/$1/src/$2',
},
};
4 changes: 2 additions & 2 deletions handlers/ticket-tailor-webhook/src/idapiService.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getSecretValue } from '@modules/secrets-manager/src/getSecret';
import { stageFromEnvironment } from '@modules/stage';
import { getSecretValue } from '@modules/secrets-manager/getSecret';
import { stageFromEnvironment } from '@modules/utils/stage';
import { z } from 'zod';

export type IdApiToken = {
Expand Down
4 changes: 2 additions & 2 deletions handlers/ticket-tailor-webhook/src/validateRequest.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createHmac, timingSafeEqual } from 'crypto';
import { getSecretValue } from '@modules/secrets-manager/src/getSecret';
import { stageFromEnvironment } from '@modules/stage';
import { getSecretValue } from '@modules/secrets-manager/getSecret';
import { stageFromEnvironment } from '@modules/utils/stage';
import type { SQSRecord } from 'aws-lambda';

export type HmacKey = {
Expand Down
2 changes: 1 addition & 1 deletion handlers/ticket-tailor-webhook/test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const mockKey: HmacKey = {
secret: '9dn189d53me1ania7d73a45d5de4674d',
};

jest.mock('@modules/secrets-manager/src/getSecret', () => ({
jest.mock('@modules/secrets-manager/getSecret', () => ({
getSecretValue: () => mockKey,
}));

Expand Down
4 changes: 2 additions & 2 deletions handlers/ticket-tailor-webhook/test/validateRequest.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ const mockKey: HmacKey = {
secret: '9dn189d53me1ania7d73a45d5de4674d',
};

jest.mock('@modules/secrets-manager/src/getSecret', () => ({
jest.mock('@modules/secrets-manager/getSecret', () => ({
getSecretValue: () => mockKey,
}));

beforeEach(() => {
process.env.Stage = 'CODE';
jest.resetAllMocks();
jest.mock('@modules/secrets-manager/src/getSecret', () => ({
jest.mock('@modules/secrets-manager/getSecret', () => ({
getSecretValue: () => mockKey,
}));
});
Expand Down
1 change: 0 additions & 1 deletion handlers/update-supporter-plus-amount/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ module.exports = {
runner: 'groups',
moduleNameMapper: {
'@modules/(.*)/(.*)$': '<rootDir>/../../modules/$1/src/$2',
'@modules/(.*)$': '<rootDir>/../../modules/$1',
},
};
6 changes: 3 additions & 3 deletions handlers/update-supporter-plus-amount/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { sendEmail } from '@modules/email/email';
import { ValidationError } from '@modules/errors';
import { getIfDefined } from '@modules/nullAndUndefined';
import { ValidationError } from '@modules/utils/errors';
import { getIfDefined } from '@modules/utils/nullAndUndefined';
import { getProductCatalogFromApi } from '@modules/product-catalog/api';

Check failure on line 4 in handlers/update-supporter-plus-amount/src/index.ts

View workflow job for this annotation

GitHub Actions / gu-cdk-build (update-supporter-plus-amount)

`@modules/product-catalog/api` import should occur before import of `@modules/utils/errors`
import type { Stage } from '@modules/stage';
import type { Stage } from '@modules/utils/stage';
import { Logger } from '@modules/zuora/logger';
import { ZuoraClient } from '@modules/zuora/zuoraClient';
import type {
Expand Down
Loading
Loading