This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
closeSequelizeConnection, | |
createSequelizeInstance, | |
} from '@shared/dsql-common'; | |
import { GetOrdersRequest, schema } from './get-orders.schema'; | |
import { MetricUnit } from '@aws-lambda-powertools/metrics'; | |
import { logger } from '@shared'; | |
import { withHttpHandler } from '@shared/http-handler'; | |
import { getOrdersUseCase } from '@use-cases/get-orders'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Order, initOrderModel } from '@models/order'; | |
import { OrderEvent, initOrderEventModel } from '@models/order-event'; | |
import { Product, initProductModel } from '@models/product'; | |
import { Sequelize } from 'sequelize'; | |
let initialized = false; | |
export async function initModels(sequelize: Sequelize) { | |
if (initialized) return; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { GetOrderEventsRequest, schema } from './get-order-events.schema'; | |
import { MetricUnit } from '@aws-lambda-powertools/metrics'; | |
import { logger } from '@shared'; | |
import { getSequelizeConnection } from '@shared/dsql-common'; | |
import { withHttpHandler } from '@shared/http-handler'; | |
import { getOrderEventsUseCase } from '@use-cases/get-order-events'; | |
let connectionInitialized = false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { DsqlSigner } from '@aws-sdk/dsql-signer'; | |
import { config } from '@config'; | |
import { initModels } from '@models'; | |
import { logger } from '@shared'; | |
import pg from 'pg'; | |
import { Sequelize } from 'sequelize'; | |
const clusterId = config.get('clusterId'); | |
const region = config.get('region'); | |
const databaseUser = config.get('databaseUser'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { DsqlSigner } from '@aws-sdk/dsql-signer'; | |
import { config } from '@config'; | |
import { initModels } from '@models'; | |
import { logger } from '@shared'; | |
import pg from 'pg'; | |
import { Sequelize } from 'sequelize'; | |
const clusterId = config.get('clusterId'); | |
const region = config.get('region'); | |
const databaseUser = config.get('databaseUser'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# run example: ./deploy-client.sh <s3-bucket-name> <cloudfront-distribution-id> <path-to-local-files> | |
if [ $# -ne 3 ]; then | |
echo "Usage: $0 <s3-bucket-name> <cloudfront-distribution-id> <path-to-local-files>" | |
exit 1 | |
fi | |
BUCKET_NAME=$1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Logger } from '@aws-lambda-powertools/logger'; | |
import { injectLambdaContext } from '@aws-lambda-powertools/logger/middleware'; | |
import { Metrics } from '@aws-lambda-powertools/metrics'; | |
import { logMetrics } from '@aws-lambda-powertools/metrics/middleware'; | |
import { Tracer } from '@aws-lambda-powertools/tracer'; | |
import { captureLambdaHandler } from '@aws-lambda-powertools/tracer/middleware'; | |
import middy from '@middy/core'; | |
import { Handler } from 'aws-lambda'; | |
interface StateMachineEvent { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
// add the feature-dev stage with the relevant environment config to the pipeline | |
// this is the test stage (beta) | |
const featureDevStage: PipelineStage = new PipelineStage( | |
this, | |
'FeatureDev', | |
{ | |
...environments.featureDev, | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('create-order', () => { | |
beforeEach(() => { | |
cy.visit('/'); | |
}); | |
it('should have modal closed on initial page load', () => { | |
cy.get('[data-test="create-order-modal"]').should('not.exist'); | |
}); | |
it('should open the create order modal', () => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Setup Bucket Deployment to automatically deploy new assets and invalidate cache | |
new s3deploy.BucketDeployment(this, 'ClientBucketDeployment', { | |
sources: [ | |
s3deploy.Source.asset(path.join(__dirname, '../../../../client/build')), | |
s3deploy.Source.jsonData('config.json', { | |
stage, | |
domainName: props.domainName, | |
subDomain, | |
api: `https://api-${stage}.${props.domainName}`, | |
}), // runtime config for client |
NewerOlder